Theory Phi_Type
theory Phi_Type
imports IDE_CP_Reasoning2
keywords "φtype_def" "φproperty_deriver" "let_φtype" "φtypeclass" :: thy_defn
and "deriving" "parameter_equality" :: quasi_command
begin
chapter ‹The Algebra of ‹φ›-Type›
section ‹Algebraic Properties of φ-Types›
subsection ‹Auxiliary Preliminaries›
subsubsection ‹Conditioned Operators›
definition cond_splitR ("?⇩s⇩R")
where ‹?⇩s⇩R C f = (if C then f else (λx. (x, unspec))) ›
definition cond_splitL ("?⇩s⇩L")
where ‹?⇩s⇩L C f = (if C then f else (λx. (unspec, x))) ›
abbreviation cond_splitR' ("?⇩s⇩R[_]" [30] 1000)
where ‹?⇩s⇩R[C] ≡ ?⇩s⇩R (LPR_ctrl C)›
abbreviation cond_splitL' ("?⇩s⇩L[_]" [30] 1000)
where ‹?⇩s⇩L[C] ≡ ?⇩s⇩L (LPR_ctrl C)›
lemma cond_split_red[simp, φsafe_simp]:
‹?⇩s⇩R True f = f›
‹?⇩s⇩R False f = (λx. (x, unspec))›
‹?⇩s⇩L True g = g›
‹?⇩s⇩L False g = (λx. (unspec, x))›
unfolding cond_splitR_def cond_splitL_def
by simp_all
definition cond_unionR ("?⇩j⇩R")
where ‹?⇩j⇩R C f = (if C then f else fst) ›
definition cond_unionL ("?⇩j⇩L")
where ‹?⇩j⇩L C f = (if C then f else snd) ›
abbreviation cond_unionR' ("?⇩j⇩R[_]" [30] 1000)
where ‹?⇩j⇩R[C] ≡ ?⇩j⇩R (LPR_ctrl C)›
abbreviation cond_unionL' ("?⇩j⇩L[_]" [30] 1000)
where ‹?⇩j⇩L[C] ≡ ?⇩j⇩L (LPR_ctrl C)›
lemma cond_union_red[simp, φsafe_simp]:
‹?⇩j⇩R True f = f›
‹?⇩j⇩R False f = fst›
‹?⇩j⇩L True g = g›
‹?⇩j⇩L False g = snd›
unfolding cond_unionR_def cond_unionL_def
by simp_all
lemma cond_union_simp[simp, φsafe_simp]:
‹?⇩j⇩R C fst = fst›
unfolding LPR_ctrl_def cond_unionR_def
by simp_all
definition cond_mapper :: ‹bool ⇒ (('a ⇒ 'b) ⇒ 'c ⇒ 'd)
⇒ (('a ⇒ 'b) ⇒ 'c ⇒ 'd)› ("?⇩M")
where ‹?⇩M C m = (if C then m else (λ_ _. unspec))›
abbreviation cond_mapper' ("?⇩M[_]" [30] 1000)
where ‹?⇩M[C] ≡ ?⇩M (LPR_ctrl C)›
lemma cond_mapper_red[simp, φsafe_simp]:
‹?⇩M True m = m›
‹?⇩M False m f = (λ_. unspec)›
unfolding cond_mapper_def
by simp_all
lemma cond_mapper_simp[simp, φsafe_simp]:
‹?⇩M C (λ_ _. unspec) = (λ_ _. unspec)›
unfolding LPR_ctrl_def cond_mapper_def
by simp_all
paragraph ‹mapToA_assign_id›
lemma [φreason %mapToA_assign_id+10]:
‹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇[𝗌𝖺𝖿𝖾] C
⟹ mapToA_assign_id (m f)
⟹ mapToA_assign_id (?⇩M C m f) ›
unfolding mapToA_assign_id_def Premise_def 𝗋Guard_def
by clarsimp
lemma [φreason %mapToA_assign_id+20]:
‹ mapToA_assign_id (m f)
⟹ mapToA_assign_id (?⇩M[True] m f) ›
unfolding mapToA_assign_id_def Premise_def 𝗋Guard_def
by clarsimp
lemma [φreason %mapToA_assign_id+30 for ‹mapToA_assign_id (?⇩M _ _ _ :: unit ⇒ unit)›
‹mapToA_assign_id (?⇩M[False] _ _ :: ?'a ⇒ ?'a)›,
φreason %mapToA_assign_id for ‹mapToA_assign_id (?⇩M _ _ _ :: ?'a ⇒ ?'a)›]:
‹mapToA_assign_id (?⇩M C m f :: unit ⇒ unit) ›
unfolding mapToA_assign_id_def
by (clarsimp simp: fun_eq_iff)
lemma [φreason %lookup_a_mapper]:
‹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇[𝗌𝖺𝖿𝖾] C
⟹ IDE_CP_Reasoning2.lookup_a_mapper (m f) x y
⟹ IDE_CP_Reasoning2.lookup_a_mapper (?⇩M C m f) x y ›
unfolding IDE_CP_Reasoning2.lookup_a_mapper_def Premise_def 𝗋Guard_def
by simp
lemma [φreason %lookup_a_mapper+10]:
‹ IDE_CP_Reasoning2.lookup_a_mapper (m f) x y
⟹ IDE_CP_Reasoning2.lookup_a_mapper (?⇩M[True] m f) x y ›
unfolding IDE_CP_Reasoning2.lookup_a_mapper_def
by simp
lemma [φreason %lookup_a_mapper+10]:
‹ 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[𝗌𝖺𝖿𝖾] y' : y
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 y' = unspec
⟹ IDE_CP_Reasoning2.lookup_a_mapper (?⇩M[False] m f) x y ›
unfolding IDE_CP_Reasoning2.lookup_a_mapper_def Premise_def Simplify_def
by simp
subsubsection ‹Conditioned Zip \& Unzip›
definition cond_zip ("?⇩Z")
where ‹?⇩Z C z mapper = (if C then z else mapper (λx. (x, unspec)) o fst)›
definition cond_zip⇩2 ("?⇩Z⇩2")
where ‹?⇩Z⇩2 C z mapper = (if C then z else mapper (λx. (x, unspec)) (λx. (x, unspec)) o fst)›
definition cond_zip_dom ("?⇩Z⇩D")
where ‹?⇩Z⇩D C D D' R' = (if C then D else {x. ∀a. a ∈ D' (fst x) ⟶ (a, unspec) ∈ R' (fst x)})›
definition cond_zip_dom⇩2 ("?⇩Z⇩D⇩2")
where ‹?⇩Z⇩D⇩2 C D D'⇩1 D'⇩2 R'⇩1 R'⇩2 = (
if C then D else {x. (∀a. a ∈ D'⇩1 (fst x) ⟶ (a, unspec) ∈ R'⇩1 (fst x)) ∧
(∀a. a ∈ D'⇩2 (fst x) ⟶ (a, unspec) ∈ R'⇩2 (fst x)) })›
definition cond_unzip ("?⇩U⇩Z")
where ‹?⇩U⇩Z C uz mapper = (if C then uz else (λx. (mapper fst x, unspec)))›
definition cond_unzip_dom ("?⇩U⇩Z⇩D")
where ‹?⇩U⇩Z⇩D C D1 D2 R' = (if C then D1 else {x. ∀(a,b) ∈ D2 x. a ∈ R' x})›
abbreviation cond_zip' ("?⇩Z[_]" [30] 1000)
where ‹?⇩Z[C] ≡ ?⇩Z (LPR_ctrl C)›
abbreviation cond_zip'⇩2 ("?⇩Z⇩2[_]" [30] 1000)
where ‹?⇩Z⇩2[C] ≡ ?⇩Z⇩2 (LPR_ctrl C)›
abbreviation cond_zip_dom' ("?⇩Z⇩D[_]" [30] 1000)
where ‹?⇩Z⇩D[C] ≡ ?⇩Z⇩D (LPR_ctrl C)›
abbreviation cond_zip_dom'⇩2 ("?⇩Z⇩D⇩2[_]" [30] 1000)
where ‹?⇩Z⇩D⇩2[C] ≡ ?⇩Z⇩D⇩2 (LPR_ctrl C)›
abbreviation cond_unzip' ("?⇩U⇩Z[_]" [30] 1000)
where ‹?⇩U⇩Z[C] ≡ ?⇩U⇩Z (LPR_ctrl C)›
abbreviation cond_unzip_dom' ("?⇩U⇩Z⇩D[_]" [30] 1000)
where ‹?⇩U⇩Z⇩D[C] ≡ ?⇩U⇩Z⇩D (LPR_ctrl C)›
paragraph ‹Basic Rules›
lemma cond_zip_red[simp, φsafe_simp]:
‹ ?⇩Z True z mapper = z ›
‹ ?⇩Z False z mapper = mapper (λx. (x, unspec)) o fst ›
unfolding cond_zip_def
by simp_all
lemma cond_zip⇩2_red[simp, φsafe_simp]:
‹ ?⇩Z⇩2 True z mapper = z ›
‹ ?⇩Z⇩2 False z mapper = mapper (λx. (x, unspec)) (λx. (x, unspec)) o fst ›
unfolding cond_zip⇩2_def
by simp_all
lemma cond_zip_dom_red[simp, φsafe_simp]:
‹ ?⇩Z⇩D True D D' R' = D ›
‹ ?⇩Z⇩D False D D' R' = {x. ∀a. a ∈ D' (fst x) ⟶ (a, unspec) ∈ R' (fst x)} ›
unfolding cond_zip_dom_def
by simp_all
lemma cond_zip_dom⇩2_red[simp, φsafe_simp]:
‹ ?⇩Z⇩D⇩2 True D D'⇩1 D'⇩2 R'⇩1 R'⇩2 = D ›
‹ ?⇩Z⇩D⇩2 False D D'⇩1 D'⇩2 R'⇩1 R'⇩2 =
{x. (∀a. a ∈ D'⇩1 (fst x) ⟶ (a, unspec) ∈ R'⇩1 (fst x)) ∧
(∀a. a ∈ D'⇩2 (fst x) ⟶ (a, unspec) ∈ R'⇩2 (fst x)) } ›
unfolding cond_zip_dom⇩2_def
by simp_all
lemma cond_unzip_red[simp, φsafe_simp]:
‹ ?⇩U⇩Z True uz m = uz ›
‹ ?⇩U⇩Z False uz m x = (m fst x, unspec) ›
unfolding cond_unzip_def
by simp_all
lemma cond_unzip[simp, φsafe_simp]:
‹ fst (uz x) = m fst x
⟹ fst (?⇩U⇩Z flag uz m x) = m fst x ›
unfolding cond_unzip_def
by clarsimp
lemma cond_unzip_dom_red[simp, φsafe_simp]:
‹ ?⇩U⇩Z⇩D True D1 D2 R' = D1 ›
‹ ?⇩U⇩Z⇩D False D1 D2 R' = {x. ∀(a,b) ∈ D2 x. a ∈ R' x} ›
unfolding cond_unzip_dom_def
by simp_all
lemma cond_unzip_dom_simp[simp, φsafe_simp]:
‹ ?⇩U⇩Z⇩D C UNIV (λ_. {}) R' = UNIV ›
‹ ?⇩U⇩Z⇩D C UNIV D' (λ_. UNIV) = UNIV ›
unfolding cond_unzip_dom_def
by simp_all
lemma cond_zip_dom_simp[simp, φsafe_simp]:
‹ ?⇩Z⇩D C UNIV (λ_. {}) R' = UNIV ›
‹ ?⇩Z⇩D C UNIV D' (λ_. UNIV) = UNIV ›
‹ x ∈ ?⇩Z⇩D C D D' (λ_. UNIV) ⟷ (C ⟶ x ∈ D) ›
‹ x ∈ ?⇩Z⇩D C D (λ_. {}) R' ⟷ (C ⟶ x ∈ D) ›
unfolding cond_zip_dom_def
by simp_all
lemma cond_zip_dom⇩2_simp[simp, φsafe_simp]:
‹ ?⇩Z⇩D⇩2 C UNIV (λ_. {}) (λ_. {}) R'⇩1 R'⇩2 = UNIV ›
‹ ?⇩Z⇩D⇩2 C UNIV D'⇩1 D'⇩2 (λ_. UNIV) (λ_. UNIV) = UNIV ›
‹ x ∈ ?⇩Z⇩D⇩2 C D D'⇩1 D'⇩2 (λ_. UNIV) (λ_. UNIV) ⟷ (C ⟶ x ∈ D) ›
‹ x ∈ ?⇩Z⇩D⇩2 C D (λ_. {}) (λ_. {}) R'⇩1 R'⇩2 ⟷ (C ⟶ x ∈ D) ›
unfolding cond_zip_dom⇩2_def
by simp_all
subsubsection ‹Separatable Mapping›
definition separatable_unzip
where ‹separatable_unzip z uz D⇩u m m⇩1 m⇩2 f g ⟷
(∀x∈D⇩u. z (map_prod (m⇩1 f) (m⇩2 g) (uz x)) = m (map_prod f g) x) ›
definition separatable_cond_unzip
where ‹separatable_cond_unzip C z uz D⇩u m m⇩1 m⇩2 f g ⟷
((¬C ⟶ g = (λ_. unspec)) ⟶ separatable_unzip z uz D⇩u m m⇩1 m⇩2 f g)›
definition separatable_zip
where ‹separatable_zip uz z D⇩z m m⇩1 m⇩2 f g ⟷
(∀x∈D⇩z. uz (m (map_prod f g) (z x)) = map_prod (m⇩1 f) (m⇩2 g) x)›
definition separatable_cond_zip
where ‹separatable_cond_zip C uz z D⇩z m m⇩1 m⇩2 f g ⟷
((¬C ⟶ g = (λ_. unspec)) ⟶ separatable_zip uz z D⇩z m m⇩1 m⇩2 f g)›
definition compositional_mapper
where ‹compositional_mapper m⇩1 m⇩2 m⇩3 D f g ⟷
(∀x ∈ D. m⇩1 f (m⇩2 g x) = m⇩3 (f o g) x)›
definition domain_of_inner_map
where ‹domain_of_inner_map mapper D⇩i ⟷
(∀f g x. (∀a ∈ D⇩i x. f a = g a) ⟶ mapper f x = mapper g x)›
definition domain_by_mapper
where ‹domain_by_mapper D' m D f D⇩x ⟷ (∀x∈D⇩x. D' (m f x) ⊆ f ` D x)›
definition separatable_module_zip
where ‹separatable_module_zip flag d a b c uz' z' uz z D f⇩b f⇩c f⇩d f⇩a ⟷
(∀x. D x ((f⇩b ⊗⇩f f⇩c o uz b c o z d a) x) ⟶
(if flag then dabc_equation d a b c else dabc_equation b c d a) ⟶
(uz' d a o z' b c o f⇩b ⊗⇩f f⇩c o uz b c o z d a) x = (f⇩d ⊗⇩f f⇩a) x)›
definition module_mapper⇩1⇩ε
where ‹module_mapper⇩1⇩ε ε e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D f f'
⟷ (∀x. D x ⟶ i⇩ε (f (e⇩ε x)) = f' x ∧ D⇩ε⇩E x ∧ D⇩ε⇩I (f (e⇩ε x)) ) ›
definition module_mapper⇩2⇩2
where ‹module_mapper⇩2⇩2 flag d a b c sp' jn' sp jn D⇩s⇩p' D⇩j⇩n' D⇩s⇩p D⇩j⇩n D⇩M f⇩c f⇩b f⇩a f⇩d ⟷
(∀x. D⇩M x ⟶
(if flag then dabc_equation d a b c else dabc_equation b c d a) ⟶
(let (x⇩a,x⇩d) = x
; (x⇩c,x⇩b) = sp c b (jn a d (x⇩a,x⇩d))
; (y⇩c,y⇩b) = (f⇩c x⇩c, f⇩b x⇩b)
; (y⇩a,y⇩d) = sp' a d (jn' c b (y⇩c,y⇩b))
in (y⇩a,y⇩d) = (f⇩a x⇩a, f⇩d x⇩d) ∧
D⇩j⇩n a d (x⇩a,x⇩d) ∧
D⇩s⇩p c b (jn a d (x⇩a,x⇩d)) ∧
D⇩j⇩n' c b (y⇩c,y⇩b) ∧
D⇩s⇩p' a d (jn' c b (y⇩c,y⇩b))
))›
definition module_mapper⇩1⇩3⇩C
where ‹module_mapper⇩1⇩3⇩C C⇩c C⇩d d a da c sp jn D⇩s⇩p D⇩j⇩n D f⇩d f⇩a f⇩c f g ⟷
(∀x. D x ⟶
?⇩+ True da = ?⇩+ C⇩d d + ?⇩+ True a ∧ (C⇩c ⟶ da ##⇩+ c) ∧ (C⇩d ⟶ d ##⇩+ a) ⟶
(let (x⇩a,x⇩d,x⇩c) = x
; y = f (?⇩j⇩R C⇩c (jn da c) (?⇩j⇩L C⇩d (jn d a) (x⇩d, x⇩a), x⇩c))
; (y⇩d⇩a,y⇩c) = ?⇩s⇩R C⇩c (sp da c) y
; (y⇩d,y⇩a) = ?⇩s⇩L C⇩d (sp d a) y⇩d⇩a
in g x = ?⇩j⇩R C⇩c (jn da c) (?⇩j⇩L C⇩d (jn d a) (x⇩d, x⇩a), x⇩c) ∧
(y⇩a,y⇩c,y⇩d) = (f⇩a x⇩a, f⇩c x⇩c, f⇩d x⇩d) ∧
(C⇩d ⟶ D⇩j⇩n d a (x⇩d, x⇩a) ∧
D⇩s⇩p d a y⇩d⇩a) ∧
(C⇩c ⟶ D⇩j⇩n da c (?⇩j⇩L C⇩d (jn d a) (x⇩d, x⇩a), x⇩c) ∧
D⇩s⇩p da c y)))›
definition module_mapper⇩1⇩3
where ‹module_mapper⇩1⇩3 d a c sp jn D⇩s⇩p D⇩j⇩n D f⇩d f⇩a f⇩c f g ⟷
(∀x. D x ⟶
d+a ##⇩+ c ∧ d ##⇩+ a ⟶
(let (x⇩a,x⇩d,x⇩c) = x
; y = f (jn (d+a) c (jn d a (x⇩d, x⇩a), x⇩c))
; (y⇩d⇩a,y⇩c) = sp (d+a) c y
; (y⇩d,y⇩a) = sp d a y⇩d⇩a
in g x = jn (d+a) c (jn d a (x⇩d, x⇩a), x⇩c) ∧
(y⇩a,y⇩c,y⇩d) = (f⇩a x⇩a, f⇩c x⇩c, f⇩d x⇩d) ∧
D⇩j⇩n d a (x⇩d, x⇩a) ∧ D⇩s⇩p d a y⇩d⇩a ∧
D⇩j⇩n (d+a) c (jn d a (x⇩d, x⇩a), x⇩c) ∧ D⇩s⇩p (d+a) c y))›
definition module_mapper⇩1⇩2⇩L
where ‹module_mapper⇩1⇩2⇩L d a sp jn D⇩s⇩p D⇩j⇩n D f⇩d f⇩a f ⟷
(∀x. D x ⟶
d ##⇩+ a ⟶
(let (x⇩d,x⇩a) = x
; y = f (jn d a (x⇩d,x⇩a))
; (y⇩d,y⇩a) = sp d a y
in (y⇩d,y⇩a) = (f⇩d x⇩d, f⇩a x⇩a) ∧
D⇩j⇩n d a (x⇩d,x⇩a) ∧ D⇩s⇩p d a y))›
definition module_mapper⇩1⇩2⇩R
where ‹module_mapper⇩1⇩2⇩R a c sp jn D⇩s⇩p D⇩j⇩n D f⇩a f⇩c f ⟷
(∀x. D x ⟶
a ##⇩+ c ⟶
(let (x⇩a,x⇩c) = x
; y = f (jn a c (x⇩a, x⇩c))
; (y⇩a,y⇩c) = sp a c y
in (y⇩a,y⇩c) = (f⇩a x⇩a, f⇩c x⇩c) ∧ D⇩j⇩n a c (x⇩a, x⇩c) ∧ D⇩s⇩p a c y))›
definition module_mapper⇩3⇩1⇩C
where ‹module_mapper⇩3⇩1⇩C C⇩c C⇩d c b db d sp jn D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f' g ⟷
(∀x. D x ⟶
(?⇩+ True db = ?⇩+ C⇩d d + ?⇩+ True b) ∧ (C⇩c ⟶ db ##⇩+ c) ∧ (C⇩d ⟶ d ##⇩+ b) ⟶
(let (x⇩d⇩b, x⇩c) = ?⇩s⇩R C⇩c (sp db c) x
; (x⇩d, x⇩b) = ?⇩s⇩L C⇩d (sp d b) x⇩d⇩b
in g x = (x⇩d, x⇩b, x⇩c) ∧
(((?⇩j⇩R C⇩c (jn db c) o apfst (?⇩j⇩L C⇩d (jn d b))) o
((f⇩d ⊗⇩f f) ⊗⇩f f⇩c) o
(apfst (?⇩s⇩L C⇩d (sp d b)) o ?⇩s⇩R C⇩c (sp db c))) x = f' x) ∧
(C⇩d ⟶ D⇩j⇩n d b (f⇩d x⇩d, f x⇩b) ∧ D⇩s⇩p d b x⇩d⇩b) ∧
(C⇩c ⟶ D⇩j⇩n db c (?⇩j⇩L C⇩d (jn d b) (f⇩d x⇩d, f x⇩b), f⇩c x⇩c) ∧
D⇩s⇩p db c x)))›
definition module_mapper⇩3⇩1
where ‹module_mapper⇩3⇩1 c b d sp jn D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f' g ⟷
(∀x. D x ⟶ (let (x⇩d⇩b, x⇩c) = sp (d+b) c x
; (x⇩d, x⇩b) = sp d b x⇩d⇩b
in g x = (x⇩d, x⇩b, x⇩c) ∧
(((jn (d+b) c o apfst (jn d b)) o
((f⇩d ⊗⇩f f) ⊗⇩f f⇩c) o
(apfst (sp d b) o sp (d+b) c)) x = f' x) ∧
D⇩j⇩n d b (f⇩d x⇩d, f x⇩b) ∧ D⇩s⇩p d b x⇩d⇩b ∧
D⇩j⇩n (d+b) c (jn d b (f⇩d x⇩d, f x⇩b), f⇩c x⇩c) ∧
D⇩s⇩p (d+b) c x))›
definition module_mapper⇩2⇩1⇩R
where ‹module_mapper⇩2⇩1⇩R b c sp jn D⇩s⇩p D⇩j⇩n D f⇩c f f' ⟷
(∀x. D x ⟶
b ##⇩+ c ⟶
(let (x⇩b, x⇩c) = sp b c x
in ((jn b c o f ⊗⇩f f⇩c o sp b c) x = f' x) ∧
D⇩j⇩n b c (f x⇩b, f⇩c x⇩c) ∧
D⇩s⇩p b c x))›
definition module_mapper⇩2⇩1⇩L
where ‹module_mapper⇩2⇩1⇩L b d sp jn D⇩s⇩p D⇩j⇩n D f f⇩d f' ⟷
(∀x. D x ⟶
d ##⇩+ b ⟶
(let (x⇩d, x⇩b) = sp d b x
in ((jn d b o f⇩d ⊗⇩f f o sp d b) x = f' x) ∧
D⇩j⇩n d b (f⇩d x⇩d, f x⇩b) ∧ D⇩s⇩p d b x))›
definition module_mapper⇩3⇩ε⇩C
where ‹module_mapper⇩3⇩ε⇩C C⇩c C⇩d c ε dε d sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f' g ⟷
(∀x. D x ⟶
(?⇩+ True dε = ?⇩+ C⇩d d + ?⇩+ True ε) ∧ (C⇩c ⟶ dε ##⇩+ c) ∧ (C⇩d ⟶ d ##⇩+ ε) ⟶
(let (x⇩d⇩ε, x⇩c) = ?⇩s⇩R C⇩c (sp dε c) x
; (x⇩d, x⇩ε) = ?⇩s⇩L C⇩d (sp d ε) x⇩d⇩ε
in g x = (x⇩d, e⇩ε x⇩ε, x⇩c) ∧
(((?⇩j⇩R C⇩c (jn dε c) o apfst (?⇩j⇩L C⇩d (jn d ε))) o
((f⇩d ⊗⇩f (i⇩ε o f o e⇩ε)) ⊗⇩f f⇩c) o
(apfst (?⇩s⇩L C⇩d (sp d ε)) o ?⇩s⇩R C⇩c (sp dε c))) x = f' x) ∧
D⇩ε⇩E x⇩ε ∧ D⇩ε⇩I (f (e⇩ε x⇩ε)) ∧
(C⇩d ⟶ D⇩j⇩n d ε (f⇩d x⇩d, i⇩ε (f (e⇩ε x⇩ε))) ∧ D⇩s⇩p d ε x⇩d⇩ε) ∧
(C⇩c ⟶ D⇩j⇩n dε c (?⇩j⇩L C⇩d (jn d ε) (f⇩d x⇩d, i⇩ε (f (e⇩ε x⇩ε))), f⇩c x⇩c) ∧
D⇩s⇩p dε c x)))›
definition module_mapper⇩3⇩ε
where ‹module_mapper⇩3⇩ε c ε d sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f' g ⟷
(∀x. D x ⟶ (let (x⇩d⇩ε, x⇩c) = sp (d+ε) c x
; (x⇩d, x⇩ε) = sp d ε x⇩d⇩ε
in g x = (x⇩d, e⇩ε x⇩ε, x⇩c) ∧
(((jn (d+ε) c o apfst (jn d ε)) o
((f⇩d ⊗⇩f (i⇩ε o f o e⇩ε)) ⊗⇩f f⇩c) o
(apfst (sp d ε) o sp (d+ε) c)) x = f' x) ∧
D⇩ε⇩E x⇩ε ∧ D⇩ε⇩I (f (e⇩ε x⇩ε)) ∧
D⇩j⇩n d ε (f⇩d x⇩d, i⇩ε (f (e⇩ε x⇩ε))) ∧ D⇩s⇩p d ε x⇩d⇩ε ∧
D⇩j⇩n (d+ε) c (jn d ε (f⇩d x⇩d, i⇩ε (f (e⇩ε x⇩ε))), f⇩c x⇩c) ∧
D⇩s⇩p (d+ε) c x))›
definition module_mapper⇩2⇩ε⇩R
where ‹module_mapper⇩2⇩ε⇩R c ε sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f⇩c f f' g ⟷
(∀x. D x ⟶ (let (x⇩ε, x⇩c) = sp ε c x
in g x = (e⇩ε x⇩ε, x⇩c) ∧
((jn ε c o (i⇩ε o f o e⇩ε) ⊗⇩f f⇩c o sp ε c) x = f' x) ∧
D⇩ε⇩E x⇩ε ∧ D⇩ε⇩I (f (e⇩ε x⇩ε)) ∧
D⇩j⇩n ε c (i⇩ε (f (e⇩ε x⇩ε)), f⇩c x⇩c) ∧
D⇩s⇩p ε c x))›
definition module_mapper⇩2⇩ε⇩L
where ‹module_mapper⇩2⇩ε⇩L ε d sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f f⇩d f' g ⟷
(∀x. D x ⟶
d ##⇩+ ε ⟶
(let (x⇩d, x⇩ε) = sp d ε x
in g x = (x⇩d, e⇩ε x⇩ε) ∧
((jn d ε o f⇩d ⊗⇩f (i⇩ε o f o e⇩ε) o sp d ε) x = f' x) ∧
D⇩ε⇩E x⇩ε ∧ D⇩ε⇩I (f (e⇩ε x⇩ε)) ∧
D⇩j⇩n d ε (f⇩d x⇩d, i⇩ε (f (e⇩ε x⇩ε))) ∧ D⇩s⇩p d ε x))›
paragraph ‹Convention›
φreasoner_group separatable_unzip__all = (1000, [1, 3000]) for ‹separatable_unzip z uz D⇩u m m⇩1 m⇩2 f g›
‹If and how could a pairwise separated mapping ‹f ⊕⇩f g› that is applied on an unzipped structure
‹F(T∗U)› over some pair data ‹T∗U›, be represneted as element-wise mapping over the original structure.›
and separatable_unzip = (1000, [1000,1030]) in separatable_unzip__all ‹default group›
and separatable_zip__all = (1000, [1,3000]) for ‹separatable_zip uz z D⇩z m m⇩1 m⇩2 f g›
‹If and how could an element-wise mapping ‹m (f ⊕⇩f g)› of pairwisely separated element mapping ‹f ⊕⇩f g›
that is applied on the zip of two structure ‹F(T)› and ‹F(U)›, be separated to two mappings
‹m⇩1› and ‹m⇩2› over ‹F(T)› and ‹F(U)› respectively›
and separatable_zip = (1000, [1000,1030]) in separatable_zip__all ‹default group›
and separatable_zip__norm = (2000, [2000,2100]) in separatable_zip__all
‹normalization›
and compositional_mapper__all = (1000, [1, 3000]) for ‹compositional_mapper m⇩1 m⇩2 m⇩3 D f g› ‹›
and compositional_mapper = (1000, [1000,1030]) in compositional_mapper__all ‹›
and domain_of_inner_map__all = (1000, [1, 3000]) for ‹domain_of_inner_map mapper D⇩i› ‹›
and domain_of_inner_map = (1000, [1000,1030]) in domain_of_inner_map__all ‹›
and separatable_module_zip__all = (1000, [1, 3000])
for (‹separatable_module_zip flag d a b c uz' z' uz z D f g f' g'›)
‹separatable zip and unzip operations of a module φ-type›
and separatable_module_zip = (1000, [1000,1030]) in separatable_module_zip__all
‹the default group›
and module_mapper__all = (1000, [1, 3000])
for (‹module_mapper⇩3⇩ε⇩C C⇩c C⇩d c ε dε d sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f' g›,
‹module_mapper⇩3⇩ε c ε d sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f' g›,
‹module_mapper⇩2⇩ε⇩R c ε sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f⇩c f f' g›,
‹module_mapper⇩2⇩ε⇩L ε d sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f f⇩d f' g›,
‹module_mapper⇩1⇩3⇩C C⇩c C⇩d d a da c sp jn D⇩s⇩p D⇩j⇩n D f⇩d f⇩a f⇩c f g›,
‹module_mapper⇩1⇩2⇩L d a sp jn D⇩s⇩p D⇩j⇩n D f⇩d f⇩a f›,
‹module_mapper⇩3⇩1⇩C C⇩c C⇩d c b db d sp jn D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f' g›,
‹module_mapper⇩2⇩1⇩L b d sp jn D⇩s⇩p D⇩j⇩n D f f⇩d f'›)
‹transformation mappers of module φ-types›
and module_mapper = (1000, [1000, 1030]) in module_mapper__all
‹the default group›
and module_mapper_default = (10,[10,30]) in module_mapper__all
‹default rules›
and module_mapper_syserr = (0,[0,0]) < module_mapper__all
‹sys error›
declare [[
φreason_default_pattern
‹domain_by_mapper ?D' ?m ?D ?var_f _› ⇒ ‹domain_by_mapper ?D' ?m ?D _ _› (100)
and ‹separatable_unzip ?z ?uz _ ?m _ _ ?var_f ?var_g› ⇒
‹separatable_unzip ?z ?uz _ ?m _ _ _ _› (100)
and ‹separatable_cond_unzip ?C ?z ?uz _ ?m _ _ ?var_f ?var_g› ⇒
‹separatable_cond_unzip ?C ?z ?uz _ ?m _ _ _ _› (100)
and ‹separatable_zip ?uz ?z _ ?m _ _ ?var_f ?var_g› ⇒
‹separatable_zip ?uz ?z _ ?m _ _ _ _› (100)
and ‹separatable_cond_zip ?C ?uz ?z _ ?m _ _ ?var_f ?var_g› ⇒
‹separatable_cond_zip ?C ?uz ?z _ ?m _ _ _ _› (100)
and ‹compositional_mapper ?m⇩1 ?m⇩2 _ _ ?var_f ?var_g› ⇒
‹compositional_mapper ?m⇩1 _ _ _ _ _›
‹compositional_mapper _ ?m⇩2 _ _ _ _› (100)
and ‹domain_of_inner_map ?m _› ⇒ ‹domain_of_inner_map ?m _› (100)
and ‹separatable_module_zip ?flag ?var_d ?var_a ?var_b ?var_c ?uz' ?z' ?uz ?z _ _ _ _ _› ⇒
‹separatable_module_zip ?flag _ _ _ _ ?uz' ?z' ?uz ?z _ _ _ _ _› (100)
and ‹module_mapper⇩3⇩ε⇩C ?C⇩c ?C⇩d ?c ?ε ?dε ?d ?sp ?jn ?e⇩ε ?i⇩ε ?D⇩ε⇩E ?D⇩ε⇩I ?D⇩s⇩p ?D⇩j⇩n _ _ _ _ _ _› ⇒
‹module_mapper⇩3⇩ε⇩C ?C⇩c ?C⇩d ?c ?ε ?dε ?d ?sp ?jn ?e⇩ε ?i⇩ε ?D⇩ε⇩E ?D⇩ε⇩I ?D⇩s⇩p ?D⇩j⇩n _ _ _ _ _ _› (100)
and ‹module_mapper⇩3⇩ε ?c ?ε ?d ?sp ?jn ?e⇩ε ?i⇩ε ?D⇩ε⇩E ?D⇩ε⇩I ?D⇩s⇩p ?D⇩j⇩n _ _ _ _ _ _› ⇒
‹module_mapper⇩3⇩ε ?c ?ε ?d ?sp ?jn ?e⇩ε ?i⇩ε ?D⇩ε⇩E ?D⇩ε⇩I ?D⇩s⇩p ?D⇩j⇩n _ _ _ _ _ _› (100)
and ‹module_mapper⇩2⇩ε⇩R ?c ?ε ?sp ?jn ?e⇩ε ?i⇩ε ?D⇩ε⇩E ?D⇩ε⇩I ?D⇩s⇩p ?D⇩j⇩n _ _ _ _ _› ⇒
‹module_mapper⇩2⇩ε⇩R ?c ?ε ?sp ?jn ?e⇩ε ?i⇩ε ?D⇩ε⇩E ?D⇩ε⇩I ?D⇩s⇩p ?D⇩j⇩n _ _ _ _ _› (100)
and ‹module_mapper⇩2⇩ε⇩L ?ε ?d ?sp ?jn ?e⇩ε ?i⇩ε ?D⇩ε⇩E ?D⇩ε⇩I ?D⇩s⇩p ?D⇩j⇩n _ _ _ _ _› ⇒
‹module_mapper⇩2⇩ε⇩L ?ε ?d ?sp ?jn ?e⇩ε ?i⇩ε ?D⇩ε⇩E ?D⇩ε⇩I ?D⇩s⇩p ?D⇩j⇩n _ _ _ _ _› (100)
and ‹module_mapper⇩1⇩3⇩C ?C⇩c ?C⇩d ?d ?a ?da ?c ?sp ?jn ?D⇩s⇩p ?D⇩j⇩n _ _ _ _ _ _› ⇒
‹module_mapper⇩1⇩3⇩C ?C⇩c ?C⇩d ?d ?a ?da ?c ?sp ?jn ?D⇩s⇩p ?D⇩j⇩n _ _ _ _ _ _› (100)
and ‹module_mapper⇩1⇩3 ?d ?a ?c ?sp ?jn ?D⇩s⇩p ?D⇩j⇩n _ _ _ _ _ _› ⇒
‹module_mapper⇩1⇩3 ?d ?a ?c ?sp ?jn ?D⇩s⇩p ?D⇩j⇩n _ _ _ _ _ _› (100)
and ‹module_mapper⇩1⇩2⇩L ?d ?a ?sp ?jn ?D⇩s⇩p ?D⇩j⇩n _ _ _ _› ⇒
‹module_mapper⇩1⇩2⇩L ?d ?a ?sp ?jn ?D⇩s⇩p ?D⇩j⇩n _ _ _ _› (100)
and ‹module_mapper⇩1⇩2⇩R ?a ?c ?sp ?jn ?D⇩s⇩p ?D⇩j⇩n _ _ _ _› ⇒
‹module_mapper⇩1⇩2⇩R ?a ?c ?sp ?jn ?D⇩s⇩p ?D⇩j⇩n _ _ _ _› (100)
and ‹module_mapper⇩3⇩1⇩C ?C⇩c ?C⇩d ?c ?b ?db ?d ?sp ?jn ?D⇩s⇩p ?D⇩j⇩n _ _ _ _ _ _› ⇒
‹module_mapper⇩3⇩1⇩C ?C⇩c ?C⇩d ?c ?b ?db ?d ?sp ?jn ?D⇩s⇩p ?D⇩j⇩n _ _ _ _ _ _› (100)
and ‹module_mapper⇩3⇩1 ?c ?b ?d ?sp ?jn ?D⇩s⇩p ?D⇩j⇩n _ _ _ _ _ _› ⇒
‹module_mapper⇩3⇩1 ?c ?b ?d ?sp ?jn ?D⇩s⇩p ?D⇩j⇩n _ _ _ _ _ _› (100)
and ‹module_mapper⇩2⇩1⇩R ?b ?c ?sp ?jn ?D⇩s⇩p ?D⇩j⇩n _ _ _ _› ⇒
‹module_mapper⇩2⇩1⇩R ?b ?c ?sp ?jn ?D⇩s⇩p ?D⇩j⇩n _ _ _ _› (100)
and ‹module_mapper⇩2⇩1⇩L ?b ?d ?sp ?jn ?D⇩s⇩p ?D⇩j⇩n _ _ _ _› ⇒
‹module_mapper⇩2⇩1⇩L ?b ?d ?sp ?jn ?D⇩s⇩p ?D⇩j⇩n _ _ _ _› (100)
and ‹domain_by_mapper ?D' ?m ?D ?f ?D⇩d⇩m› ⇒
‹ERROR TEXT(‹Malformed Rule› (domain_by_mapper ?D' ?m ?D ?f ?D⇩d⇩m))› (0)
and ‹separatable_unzip ?z ?uz ?D⇩u ?m ?m⇩1 ?m⇩2 ?f ?g› ⇒
‹ERROR TEXT(‹Malformed Rule› (separatable_unzip ?z ?uz ?D⇩u ?m ?m⇩1 ?m⇩2 ?f ?g))› (0)
and ‹separatable_zip ?uz ?z ?D⇩z ?m ?m⇩1 ?m⇩2 ?f ?g› ⇒
‹ERROR TEXT(‹Malformed Rule› (separatable_zip ?uz ?z ?D⇩z ?m ?m⇩1 ?m⇩2 ?f ?g))› (0)
and ‹separatable_cond_unzip ?C ?z ?uz ?D⇩u ?m ?m⇩1 ?m⇩2 ?f ?g› ⇒
‹ERROR TEXT(‹Malformed Rule› (separatable_cond_unzip ?C ?z ?uz ?D⇩u ?m ?m⇩1 ?m⇩2 ?f ?g))› (0)
and ‹separatable_cond_zip ?C ?uz ?z ?D⇩z ?m ?m⇩1 ?m⇩2 ?f ?g› ⇒
‹ERROR TEXT(‹Malformed Rule› (separatable_cond_zip ?C ?uz ?z ?D⇩z ?m ?m⇩1 ?m⇩2 ?f ?g))› (0)
and ‹compositional_mapper ?m⇩1 ?m⇩2 ?m⇩3 ?D ?f ?g› ⇒
‹ERROR TEXT(‹Malformed Rule› (compositional_mapper ?m⇩1 ?m⇩2 ?m⇩3 ?D ?f ?g))› (0)
and ‹domain_of_inner_map ?m ?D⇩i› ⇒
‹ERROR TEXT(‹Malformed Rule› (domain_of_inner_map ?m ?D⇩i))› (0)
and ‹separatable_module_zip ?flag ?d ?a ?b ?c ?uz' ?z' ?uz ?z ?D ?f ?g ?f' ?g'› ⇒
‹ERROR TEXT(‹Malformed Rule› (separatable_module_zip ?flag ?d ?a ?b ?c ?uz' ?z' ?uz ?z ?D ?f ?g ?f' ?g'))› (0)
,
φdefault_reasoner_group
‹separatable_unzip _ _ _ _ _ _ _ _› : %separatable_unzip (100)
and ‹separatable_zip _ _ _ _ _ _ _ _› : %separatable_zip (100)
and ‹separatable_cond_unzip _ _ _ _ _ _ _ _ _› : %separatable_unzip (100)
and ‹separatable_cond_zip _ _ _ _ _ _ _ _ _› : %separatable_zip (100)
and ‹compositional_mapper _ _ _ _ _ _›: %compositional_mapper (100)
and ‹domain_of_inner_map _ _› : %domain_of_inner_map (100)
and ‹separatable_module_zip _ _ _ _ _ _ _ _ _ _ _ _ _ _› : %separatable_module_zip (100)
and ‹module_mapper⇩3⇩ε⇩C _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _› : %module_mapper (100)
and ‹module_mapper⇩3⇩ε _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _› : %module_mapper (100)
and ‹module_mapper⇩2⇩ε⇩R _ _ _ _ _ _ _ _ _ _ _ _ _ _ _› : %module_mapper (100)
and ‹module_mapper⇩2⇩ε⇩L _ _ _ _ _ _ _ _ _ _ _ _ _ _ _› : %module_mapper (100)
]]
paragraph ‹Basic Rules›
subparagraph ‹Module Error›
lemma [φreason default %module_mapper_syserr]:
‹ ERROR TEXT(‹Fail to apply transformation mapper the module of spliter› sp ‹, joiner› jn
‹, identity constructor› i⇩ε ‹and destructor› e⇩ε ‹, you may provide a LPR reasoning rule›
(module_mapper⇩3⇩ε c ε d sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f' g) ‹to address the issue.›)
⟹ module_mapper⇩3⇩ε c ε d sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f' g ›
unfolding ERROR_def
by blast
lemma [φreason default %module_mapper_syserr]:
‹ ERROR TEXT(‹Fail to apply transformation mapper the module of spliter› sp ‹, joiner› jn
‹, identity constructor› i⇩ε ‹and destructor› e⇩ε ‹, you may provide a LPR reasoning rule›
(module_mapper⇩2⇩ε⇩R c ε sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f⇩c f f' g) ‹to address the issue.›)
⟹ module_mapper⇩2⇩ε⇩R c ε sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f⇩c f f' g ›
unfolding ERROR_def
by blast
lemma [φreason default %module_mapper_syserr]:
‹ ERROR TEXT(‹Fail to apply transformation mapper the module of spliter› sp ‹, joiner› jn
‹, identity constructor› i⇩ε ‹and destructor› e⇩ε ‹, you may provide a LPR reasoning rule›
(module_mapper⇩2⇩ε⇩L ε d sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f f⇩d f' g) ‹to address the issue.›)
⟹ module_mapper⇩2⇩ε⇩L ε d sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f f⇩d f' g ›
unfolding ERROR_def
by blast
lemma [φreason default %module_mapper_syserr]:
‹ ERROR TEXT(‹Fail to apply transformation mapper the module of spliter› sp ‹joiner› jn
‹, you may provide a LPR reasoning rule›
(module_mapper⇩1⇩3 d a c sp jn D⇩s⇩p D⇩j⇩n D f⇩d f⇩a f⇩c f g) ‹to address the issue.›)
⟹ module_mapper⇩1⇩3 d a c sp jn D⇩s⇩p D⇩j⇩n D f⇩d f⇩a f⇩c f g ›
unfolding ERROR_def
by blast
lemma [φreason default %module_mapper_syserr]:
‹ ERROR TEXT(‹Fail to apply transformation mapper the module of spliter› sp ‹joiner› jn
‹, you may provide a LPR reasoning rule›
(module_mapper⇩1⇩2⇩L d a sp jn D⇩s⇩p D⇩j⇩n D f⇩d f⇩a f) ‹to address the issue.›)
⟹ module_mapper⇩1⇩2⇩L d a sp jn D⇩s⇩p D⇩j⇩n D f⇩d f⇩a f ›
unfolding ERROR_def
by blast
lemma [φreason default %module_mapper_syserr]:
‹ ERROR TEXT(‹Fail to apply transformation mapper the module of spliter› sp ‹joiner› jn
‹, you may provide a LPR reasoning rule›
(module_mapper⇩1⇩2⇩R a c sp jn D⇩s⇩p D⇩j⇩n D f⇩a f⇩c f) ‹to address the issue.›)
⟹ module_mapper⇩1⇩2⇩R a c sp jn D⇩s⇩p D⇩j⇩n D f⇩a f⇩c f ›
unfolding ERROR_def
by blast
lemma [φreason default %module_mapper_syserr]:
‹ ERROR TEXT(‹Fail to apply transformation mapper the module of spliter› sp ‹joiner› jn
‹, you may provide a LPR reasoning rule›
(module_mapper⇩3⇩1 c b d sp jn D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f' g) ‹to address the issue.›)
⟹ module_mapper⇩3⇩1 c b d sp jn D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f' g ›
unfolding ERROR_def
by blast
lemma [φreason default %module_mapper_syserr]:
‹ ERROR TEXT(‹Fail to apply transformation mapper the module of spliter› sp ‹joiner› jn
‹, you may provide a LPR reasoning rule›
(module_mapper⇩2⇩1⇩L b d sp jn D⇩s⇩p D⇩j⇩n D f f⇩d f') ‹to address the issue.›)
⟹ module_mapper⇩2⇩1⇩L b d sp jn D⇩s⇩p D⇩j⇩n D f f⇩d f' ›
unfolding ERROR_def
by blast
lemma [φreason default %module_mapper_syserr]:
‹ ERROR TEXT(‹Fail to apply transformation mapper the module of spliter› sp ‹joiner› jn
‹, you may provide a LPR reasoning rule›
(module_mapper⇩2⇩1⇩R b c sp jn D⇩s⇩p D⇩j⇩n D f⇩c f f') ‹to address the issue.›)
⟹ module_mapper⇩2⇩1⇩R b c sp jn D⇩s⇩p D⇩j⇩n D f⇩c f f' ›
unfolding ERROR_def
by blast
subparagraph ‹Module Conversions›
lemma [φreason default %module_mapper_default]:
‹ module_mapper⇩3⇩ε c ε d sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f' g
⟹ module_mapper⇩3⇩ε⇩C True True c ε dε d sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f' g ›
unfolding module_mapper⇩3⇩ε⇩C_def module_mapper⇩3⇩ε_def
by simp
lemma [φreason default %module_mapper_default]:
‹ module_mapper⇩2⇩ε⇩R c ε sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f⇩c f f' g
⟹ module_mapper⇩3⇩ε⇩C True False c ε dε d sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f'
(λx. case g x of (ε,c) ⇒ (unspec,ε,c)) ›
unfolding module_mapper⇩3⇩ε⇩C_def module_mapper⇩2⇩ε⇩R_def
by clarsimp fastforce
lemma [φreason default %module_mapper_default]:
‹ module_mapper⇩2⇩ε⇩L ε d sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f f⇩d f' g
⟹ module_mapper⇩3⇩ε⇩C False True c ε dε d sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f'
(λx. case g x of (d,ε) ⇒ (d,ε,unspec)) ›
unfolding module_mapper⇩3⇩ε⇩C_def module_mapper⇩2⇩ε⇩L_def
by clarsimp fastforce
lemma [φreason default %module_mapper_default]:
‹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 ε = dε
⟹ module_mapper⇩1⇩ε ε e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D f f'
⟹ module_mapper⇩3⇩ε⇩C False False c ε dε d sp jn e⇩ε i⇩ε D⇩ε⇩E D⇩ε⇩I D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f'
(λx. (unspec, e⇩ε x, unspec)) ›
unfolding module_mapper⇩3⇩ε⇩C_def module_mapper⇩1⇩ε_def 𝗋Guard_def Premise_def
by simp
lemma [φreason default %module_mapper_default]:
‹ module_mapper⇩1⇩3 d a c sp jn D⇩s⇩p D⇩j⇩n D f⇩d f⇩a f⇩c f g
⟹ module_mapper⇩1⇩3⇩C True True d a da c sp jn D⇩s⇩p D⇩j⇩n D f⇩d f⇩a f⇩c f g ›
unfolding module_mapper⇩1⇩3⇩C_def module_mapper⇩1⇩3_def
by clarsimp
lemma [φreason default %module_mapper_default]:
‹ module_mapper⇩1⇩2⇩L d a sp jn D⇩s⇩p D⇩j⇩n D f⇩d f⇩a f
⟹ module_mapper⇩1⇩3⇩C False True d a da c sp jn D⇩s⇩p D⇩j⇩n
(λ(x⇩a,x⇩d,x⇩c). D (x⇩d,x⇩a)) f⇩d f⇩a (λ_. unspec) f (λ(x⇩a,x⇩d,x⇩c). jn d a (x⇩d,x⇩a)) ›
unfolding module_mapper⇩1⇩3⇩C_def module_mapper⇩1⇩2⇩L_def Let_def
by clarsimp fastforce
lemma [φreason default %module_mapper_default]:
‹ module_mapper⇩1⇩2⇩R a c sp jn D⇩s⇩p D⇩j⇩n D f⇩a f⇩c f
⟹ module_mapper⇩1⇩3⇩C True False d a da c sp jn D⇩s⇩p D⇩j⇩n
(λ(x⇩a,x⇩d,x⇩c). D (x⇩a,x⇩c)) (λ_. unspec) f⇩a f⇩c f (λ(x⇩a,x⇩d,x⇩c). jn a c (x⇩a,x⇩c)) ›
unfolding module_mapper⇩1⇩3⇩C_def module_mapper⇩1⇩2⇩R_def Let_def
by clarsimp fastforce
lemma [φreason default %module_mapper_default]:
‹ module_mapper⇩3⇩1 c b d sp jn D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f' g
⟹ module_mapper⇩3⇩1⇩C True True c b db d sp jn D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f' g ›
unfolding module_mapper⇩3⇩1_def module_mapper⇩3⇩1⇩C_def
by clarsimp
lemma [φreason default %module_mapper_default]:
‹ module_mapper⇩2⇩1⇩L b d sp jn D⇩s⇩p D⇩j⇩n D f f⇩d f'
⟹ module_mapper⇩3⇩1⇩C False True c b db d sp jn D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f'
(λx. case sp d b x of (x⇩d,x⇩b) ⇒ (x⇩d, x⇩b, unspec)) ›
unfolding module_mapper⇩2⇩1⇩L_def module_mapper⇩3⇩1⇩C_def
by clarsimp fastforce
lemma [φreason default %module_mapper_default]:
‹ module_mapper⇩2⇩1⇩R b c sp jn D⇩s⇩p D⇩j⇩n D f⇩c f f'
⟹ module_mapper⇩3⇩1⇩C True False c b db d sp jn D⇩s⇩p D⇩j⇩n D f⇩c f f⇩d f'
(λx. case sp b c x of (x⇩b, x⇩c) ⇒ (unspec, x⇩b, x⇩c))›
unfolding module_mapper⇩3⇩1⇩C_def module_mapper⇩2⇩1⇩R_def
by clarsimp fastforce
lemma [φreason default %module_mapper_default]:
‹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 b = db
⟹ module_mapper⇩3⇩1⇩C False False c b db d sp jn D⇩s⇩p D⇩j⇩n (λ_. True) f⇩c f f⇩d f
(λx. (unspec, x, unspec))›
unfolding module_mapper⇩3⇩1⇩C_def module_mapper⇩2⇩1⇩R_def
by clarsimp
paragraph ‹Instances›
subparagraph ‹Identity Mappers›
lemma [φreason add]:
‹ separatable_unzip (λx. x) (λx. x) UNIV (λf. f) (λf. f) (λf. f) g r ›
unfolding separatable_unzip_def
by simp
lemma [φreason add]:
‹ separatable_zip (λx. x) (λx. x) UNIV (λf. f) (λf. f) (λf. f) f g ›
unfolding separatable_zip_def
by simp
lemma [φreason add]:
‹ compositional_mapper (λf. f) (λf. f) (λf. f) UNIV f g ›
unfolding compositional_mapper_def
by simp
lemma [φreason add]:
‹ domain_of_inner_map (λf. f) (λx. {x}) ›
unfolding domain_of_inner_map_def
by simp
lemma [φreason add]:
‹domain_by_mapper (λx. {x}) (λf. f) (λx. {x}) f UNIV›
unfolding domain_by_mapper_def
by clarsimp
subparagraph ‹Conditioned›
lemma [φreason %separatable_zip__norm]:
‹ separatable_cond_unzip (LPR_ctrl C) (?⇩Z (LPR_ctrl C) z m⇩Z) (?⇩U⇩Z (LPR_ctrl C) uz m⇩U) D⇩U' m m⇩f m⇩g f g
⟹ separatable_cond_unzip C (?⇩Z (LPR_ctrl C) z m⇩Z) (?⇩U⇩Z (LPR_ctrl C) uz m⇩U) D⇩U' m m⇩f m⇩g f g ›
unfolding LPR_ctrl_def .
lemma [φreason %separatable_zip__norm]:
‹ separatable_cond_zip (LPR_ctrl C) (?⇩U⇩Z (LPR_ctrl C) uz m⇩U) (?⇩Z (LPR_ctrl C) z m⇩Z) D⇩U' m m⇩f m⇩g f g
⟹ separatable_cond_zip C (?⇩U⇩Z (LPR_ctrl C) uz m⇩U) (?⇩Z (LPR_ctrl C) z m⇩Z) D⇩U' m m⇩f m⇩g f g ›
unfolding LPR_ctrl_def .
lemma [φreason add]:
‹ 𝗀𝗎𝖺𝗋𝖽 separatable_unzip z uz D⇩U m m⇩f m⇩g f g ∧⇩𝗋
compositional_mapper m⇩f m⇩U m⇩2 D⇩m f fst ∧⇩𝗋
compositional_mapper m⇩Z m⇩2 m D⇩m⇩2 (λx. (x, unspec)) (f o fst)
⟹ 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φinstantiation] D⇩U' : {x. if C then x ∈ D⇩U else x ∈ D⇩m ∩ D⇩m⇩2}
⟹ separatable_cond_unzip C (?⇩Z C z m⇩Z) (?⇩U⇩Z C uz m⇩U) D⇩U' m m⇩f (?⇩M C m⇩g) f g ›
unfolding 𝗋Guard_def compositional_mapper_def Ant_Seq_def
separatable_unzip_def separatable_cond_unzip_def Simplify_def
by (cases C; clarsimp; metis prod.map_beta)
lemma [φreason add]:
‹ 𝗀𝗎𝖺𝗋𝖽 separatable_zip uz z D⇩U m m⇩f m⇩g f g ∧⇩𝗋
compositional_mapper m m⇩Z m⇩2 D⇩m (f ⊗⇩f (λ_. unspec)) (λx. (x, unspec)) ∧⇩𝗋
compositional_mapper m⇩U m⇩2 m⇩f D⇩m⇩2 fst (λx. (f x, unspec))
⟹ 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φinstantiation] D⇩U' : {x. if C then x ∈ D⇩U else fst x ∈ D⇩m ∩ D⇩m⇩2}
⟹ separatable_cond_zip C (?⇩U⇩Z C uz m⇩U) (?⇩Z C z m⇩Z) D⇩U' m m⇩f (?⇩M C m⇩g) f g ›
unfolding 𝗋Guard_def compositional_mapper_def Ant_Seq_def
separatable_zip_def separatable_cond_zip_def Simplify_def
by (cases C; clarsimp)
subparagraph ‹List›
lemma [φreason for ‹
module_mapper⇩1⇩ε ?ε hd (λx. [x]) (λl. length l = _) (λ_. True) _ _ _ ›]:
‹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 one = 1
⟹ module_mapper⇩1⇩ε one' hd (λx. [x]) (λl. length l = one) (λ_. True) (λl. length l = 1) f (map f) ›
unfolding module_mapper⇩1⇩ε_def 𝗋Guard_def Premise_def
by (simp, metis Suc_length_conv length_0_conv length_map list.map_sel(1) list.sel(1))
lemma [φreason for
‹module_mapper⇩2⇩ε⇩R ?c ⟦?j : _⦆
(λs t x. (take (len_intvl.len s) x, drop (len_intvl.len s) x))
(λs t (x, y). x @ y) hd (λx. [x])
(λl. length l = _) (λ_. True)
(λs t x. length x = len_intvl.len s + len_intvl.len t)
(λs t (x,y). length x = len_intvl.len s ∧ length y = len_intvl.len t) _ _ _ _ _ ›]:
‹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 one = 1 ∧ one' = 1
⟹ module_mapper⇩2⇩ε⇩R c ⟦j : one⦆
(λs t x. (take (len_intvl.len s) x, drop (len_intvl.len s) x))
(λs t (x, y). x @ y) hd
(λx. [x]) (λl. length l = one') (λ_. True)
(λs t x. length x = len_intvl.len s + len_intvl.len t)
(λs t (x, y). length x = len_intvl.len s ∧ length y = len_intvl.len t)
(λx. length x = 1 + len_intvl.len c ∧ length_preserving_map {drop 1 x} f⇩c)
f⇩c f
( list_upd_map 0 f o sublist_map_R 1 f⇩c )
(λl. (hd l, drop 1 l)) ›
unfolding module_mapper⇩2⇩ε⇩R_def sublist_map_L_def list_upd_map_def sublist_map_R_def
length_preserving_map_def 𝗋Guard_def Premise_def
by (auto simp add: hd_drop_conv_nth nth_append upd_conv_take_nth_drop hd_conv_nth)
lemma [φreason for
‹module_mapper⇩2⇩ε⇩L ⟦?j : _⦆ ?d
(λs t x. (take (len_intvl.len s) x, drop (len_intvl.len s) x))
(λs t (x,y). x @ y) hd (λx. [x])
(λl. length l = _) (λ_. True)
(λs t x. length x = len_intvl.len s + len_intvl.len t)
(λs t (x,y). length x = len_intvl.len s ∧ length y = len_intvl.len t) _ _ _ _ _ ›]:
‹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 one = 1 ∧ one' = 1
⟹ module_mapper⇩2⇩ε⇩L ⟦j : one⦆ d
(λs t x. (take (len_intvl.len s) x, drop (len_intvl.len s) x))
(λs t (x,y). x @ y) hd
(λx. [x]) (λl. length l = one') (λ_. True)
(λs t x. length x = len_intvl.len s + len_intvl.len t)
(λs t (x,y). length x = len_intvl.len s ∧ length y = len_intvl.len t)
(λx. length x = len_intvl.len d + 1 ∧ length_preserving_map {take (len_intvl.len d) x} f⇩d)
f f⇩d
( sublist_map_L (len_intvl.len d) f⇩d o list_upd_map (len_intvl.len d) f )
(λl. (take (len_intvl.len d) l, l ! (len_intvl.len d))) ›
unfolding module_mapper⇩2⇩ε⇩L_def sublist_map_L_def list_upd_map_def sublist_map_R_def
length_preserving_map_def Premise_def 𝗋Guard_def
by (auto simp add: hd_drop_conv_nth nth_append upd_conv_take_nth_drop)
lemma [φreason for
‹module_mapper⇩3⇩ε ?c ⟦?j : _⦆ ?d
(λs t x. (take (len_intvl.len s) x, drop (len_intvl.len s) x))
(λs t (x,y). x @ y) hd (λx. [x])
(λl. length l = _) (λ_. True)
(λs t x. length x = len_intvl.len s + len_intvl.len t)
(λs t (x,y). length x = len_intvl.len s ∧ length y = len_intvl.len t) _ _ _ _ _ _›]:
‹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 one = 1 ∧ one' = 1
⟹ module_mapper⇩3⇩ε c ⟦j : one⦆ d
(λs t x. (take (len_intvl.len s) x, drop (len_intvl.len s) x))
(λs t (x,y). x @ y) hd
(λx. [x]) (λl. length l = one') (λ_. True)
(λs t x. length x = len_intvl.len s + len_intvl.len t)
(λs t (x,y). length x = len_intvl.len s ∧ length y = len_intvl.len t)
(λx. length x = len_intvl.len d + 1 + len_intvl.len c ∧
length_preserving_map {drop (len_intvl.len d + 1) x} f⇩c ∧
length_preserving_map {take (len_intvl.len d) x} f⇩d)
f⇩c f f⇩d
( sublist_map_L (len_intvl.len d) f⇩d
o list_upd_map (len_intvl.len d) f
o sublist_map_R (len_intvl.len d+1) f⇩c )
(λl. (take (len_intvl.len d) l, l ! (len_intvl.len d), drop (len_intvl.len d + 1) l))›
unfolding module_mapper⇩3⇩ε_def sublist_map_L_def list_upd_map_def sublist_map_R_def
length_preserving_map_def Premise_def 𝗋Guard_def
by (auto simp add: hd_drop_conv_nth nth_append upd_conv_take_nth_drop)
subsection ‹Definitions›
subsubsection ‹Transformations›
paragraph ‹Variant Functor›
definition ‹Transformation_Functor F1 F2 T U D R mapper ⟷
(∀x g. (∀a ∈ D x. a ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U 𝗌𝗎𝖻𝗃 b. g a b) ⟶
(∀a b. a ∈ D x ∧ g a b ⟶ b ∈ R x) ⟶
(x ⦂ F1 T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F2 U 𝗌𝗎𝖻𝗃 y. mapper g x y))›
text ‹A transformation functor ‹mapper› is complete iff for a given complete transformation relation
family ‹{g⇩i}›, ‹{mapper g⇩i}› is also complete (the notion of completeness can be extended to relations naturally
by converting a relation as a function to a set).›
definition Functional_Transformation_Functor :: ‹(('b,'a) φ ⇒ ('d,'c) φ)
⇒ (('b,'e) φ ⇒ ('d,'f) φ)
⇒ ('b,'a) φ
⇒ ('b,'e) φ
⇒ ('c ⇒ 'a set)
⇒ ('c ⇒ 'e set)
⇒ (('a ⇒ 'e) ⇒ ('a ⇒ bool) ⇒ 'c ⇒ bool)
⇒ (('a ⇒ 'e) ⇒ ('a ⇒ bool) ⇒ 'c ⇒ 'f)
⇒ bool›
where ‹Functional_Transformation_Functor Fa Fb T U D R pred_mapper func_mapper ⟷
(∀x f P. (∀a ∈ D x. a ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f a ⦂ U 𝗐𝗂𝗍𝗁 P a)
⟶ (∀a. a ∈ D x ⟶ f a ∈ R x)
⟶ (x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 func_mapper f P x ⦂ Fb U 𝗐𝗂𝗍𝗁 pred_mapper f P x))›
text ‹When the element transformation is applied with a partial function (with ‹P› giving the domain),
the entire transformation is also a partial function.
The ▩‹func_mapper› is usually the functional mapper and the
▩‹pred_mapper› is the predicate mapper of an ADT. An exceptional example is set,
‹func_mapper⇩s⇩e⇩t f P S = { f x |x ∈ S. P x }› and ‹pred_mapper⇩s⇩e⇩t f P S = ⊤›,
whose (generalized) algebraic mappers are however set image and set-forall (of its element).
‹P› gives the domain of the partial map ‹f›.
‹D› gives the domain of the inner elements of the functor.
›
lemma infer_FTF_from_FT:
‹ Transformation_Functor F1 F2 T U D R mapper
⟹ Object_Equiv (F2 U) eq
⟹ (∀f P x y. mapper (λa b. b = f a ∧ P a) x y ⟶ eq y (fm f P x) ∧ pm f P x)
⟹ Functional_Transformation_Functor F1 F2 T U D R pm fm ›
unfolding Functional_Transformation_Functor_def Transformation_Functor_def
Object_Equiv_def
apply clarsimp
subgoal premises prems for x f P
by (insert prems(1)[THEN spec[where x=x], THEN spec[where x=‹λa b. b = f a ∧ P a›]]
prems(2-),
clarsimp simp add: Transformation_def,
blast) .
paragraph ‹Variant Bi-Functor›
definition ‹Transformation_BiFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 mapper ⟷
(∀x g⇩1 g⇩2. (∀a ∈ D⇩1 x. a ⦂ T⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩1 𝗌𝗎𝖻𝗃 b. g⇩1 a b) ⟶
(∀a ∈ D⇩2 x. a ⦂ T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩2 𝗌𝗎𝖻𝗃 b. g⇩2 a b) ⟶
(∀a b. a ∈ D⇩1 x ∧ g⇩1 a b ⟶ b ∈ R⇩1 x) ∧ (∀a b. a ∈ D⇩2 x ∧ g⇩2 a b ⟶ b ∈ R⇩2 x) ⟶
(x ⦂ Fa T⇩1 T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U⇩1 U⇩2 𝗌𝗎𝖻𝗃 y. mapper g⇩1 g⇩2 x y))›
definition ‹Functional_Transformation_BiFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 pred_mapper func_mapper ⟷
(∀x f⇩1 f⇩2 P⇩1 P⇩2. (∀a ∈ D⇩1 x. a ⦂ T⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f⇩1 a ⦂ U⇩1 𝗐𝗂𝗍𝗁 P⇩1 a)
⟶ (∀a ∈ D⇩2 x. a ⦂ T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f⇩2 a ⦂ U⇩2 𝗐𝗂𝗍𝗁 P⇩2 a)
⟶ (∀a. a ∈ D⇩1 x ⟶ f⇩1 a ∈ R⇩1 x) ∧ (∀a. a ∈ D⇩2 x ⟶ f⇩2 a ∈ R⇩2 x)
⟶ (x ⦂ Fa T⇩1 T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 func_mapper f⇩1 f⇩2 P⇩1 P⇩2 x ⦂ Fb U⇩1 U⇩2 𝗐𝗂𝗍𝗁 pred_mapper f⇩1 f⇩2 P⇩1 P⇩2 x))›
lemma infer_biFTF_from_biFT:
‹ Transformation_BiFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 mapper
⟹ Object_Equiv (Fb U⇩1 U⇩2) eq
⟹ (∀f⇩1 f⇩2 P⇩1 P⇩2 x y. mapper (λa b. b = f⇩1 a ∧ P⇩1 a) (λa b. b = f⇩2 a ∧ P⇩2 a) x y
⟶ eq y (fm f⇩1 f⇩2 P⇩1 P⇩2 x) ∧ pm f⇩1 f⇩2 P⇩1 P⇩2 x)
⟹ Functional_Transformation_BiFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 pm fm ›
unfolding Functional_Transformation_BiFunctor_def Transformation_BiFunctor_def
Object_Equiv_def
apply clarify
subgoal premises prems for x f⇩1 f⇩2 P⇩1 P⇩2
by (insert prems(1)[THEN spec[where x=x],
THEN spec[where x=‹λa b. b = f⇩1 a ∧ P⇩1 a›],
THEN spec[where x=‹λa b. b = f⇩2 a ∧ P⇩2 a›]]
prems(2-),
clarsimp simp add: Transformation_def,
blast) .
paragraph ‹Variant Functor with Parameterization›
definition ‹Transformation_Functor⇩Λ F1 F2 T U D R mapper ⟷
(∀x g. (∀p. ∀a ∈ D p x. a ⦂ T p 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U p 𝗌𝗎𝖻𝗃 b. g p a b) ⟶
(∀p a b. a ∈ D p x ∧ g p a b ⟶ b ∈ R p x) ⟶
(x ⦂ F1 T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F2 U 𝗌𝗎𝖻𝗃 y. mapper g x y))›
definition ‹Functional_Transformation_Functor⇩Λ Fa Fb T U D R pred_mapper func_mapper ⟷
(∀x f P. (∀p. ∀a ∈ D p x. a ⦂ T p 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f p a ⦂ U p 𝗐𝗂𝗍𝗁 P p a)
⟶ (∀p a. a ∈ D p x ⟶ f p a ∈ R p x)
⟶ (x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 func_mapper f P x ⦂ Fb U 𝗐𝗂𝗍𝗁 pred_mapper f P x))›
lemma infer_FTF⇩Λ_from_FT⇩Λ:
‹ Transformation_Functor⇩Λ F1 F2 T U D R mapper
⟹ Abstract_Domain (F1 T) P⇩T
⟹ Abstract_Domain (F2 U) P⇩U
⟹ Object_Equiv (F2 U) eq
⟹ (∀f P x y. P⇩T x ∧ P⇩U y ∧ mapper (λp a b. b = f p a ∧ P p a) x y ⟶ eq y (fm f P x) ∧ pm f P x)
⟹ Functional_Transformation_Functor⇩Λ F1 F2 T U D R pm fm ›
unfolding Functional_Transformation_Functor⇩Λ_def Transformation_Functor⇩Λ_def
Object_Equiv_def Abstract_Domain_def Action_Tag_def Satisfiable_def 𝗋EIF_def
apply clarsimp
subgoal premises prems for x f P
by (insert prems(1)[THEN spec[where x=x], THEN spec[where x=‹λp a b. b = f p a ∧ P p a›]]
prems(2-),
clarsimp simp add: Transformation_def,
blast) .
paragraph ‹(Contravariant, Variant) Bi-Functor›
definition ‹CV_TrFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 mapper ⟷
(∀x g⇩1 g⇩2. (∀a. (a ⦂ U⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ T⇩1 𝗌𝗎𝖻𝗃 b. g⇩1 b a)) ⟶
(∀a ∈ D⇩2 x. a ⦂ T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩2 𝗌𝗎𝖻𝗃 b. g⇩2 a b) ⟶
(∀a b. a ∈ D⇩2 x ∧ g⇩2 a b ⟶ b ∈ R⇩2 x) ⟶
(x ⦂ Fa T⇩1 T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U⇩1 U⇩2 𝗌𝗎𝖻𝗃 y. mapper g⇩1 g⇩2 x y))›
definition ‹Fun_CV_TrFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 FC⇩1 R⇩2 pred_mapper func_mapper ⟷
(∀x f⇩1 f⇩2 P⇩1 P⇩2. (∀a. f⇩1 a ∈ D⇩1 x ⟶ (a ⦂ U⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f⇩1 a ⦂ T⇩1 𝗐𝗂𝗍𝗁 P⇩1 a))
⟶ (∀a ∈ D⇩2 x. a ⦂ T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f⇩2 a ⦂ U⇩2 𝗐𝗂𝗍𝗁 P⇩2 a)
⟶ FC⇩1 f⇩1 x ∧ (∀a. a ∈ D⇩2 x ⟶ f⇩2 a ∈ R⇩2 x)
⟶ (x ⦂ Fa T⇩1 T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 func_mapper f⇩1 f⇩2 P⇩1 P⇩2 x ⦂ Fb U⇩1 U⇩2 𝗐𝗂𝗍𝗁 pred_mapper f⇩1 f⇩2 P⇩1 P⇩2 x))›
subsubsection ‹Separation›
definition Object_Sep_Homo⇩I :: ‹('b::sep_magma, 'a::sep_magma) φ ⇒ ('a × 'a) set ⇒ bool›
where ‹Object_Sep_Homo⇩I T D ⟷ (∀x y. (x,y) ∈ D ⟶ ((x ⦂ T) * (y ⦂ T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x * y ⦂ T 𝗐𝗂𝗍𝗁 x ## y ))›
definition ‹Object_Sep_Homo⇩E T ⟷ (∀x y. x ## y ⟶ ( (x * y ⦂ T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 (x ⦂ T) * (y ⦂ T) ))›
definition Separation_Homo⇩I :: ‹
(('b::sep_magma_1,'a) φ ⇒ ('d::sep_magma_1,'c) φ)
⇒ (('b,'e) φ ⇒ ('d,'f) φ)
⇒ (('b, 'a × 'e) φ ⇒ ('d,'g) φ)
⇒ ('b,'a) φ ⇒ ('b,'e) φ
⇒ ('c × 'f) set ⇒ ('c × 'f ⇒ 'g) ⇒ bool›
where ‹Separation_Homo⇩I Ft Fu F3 T U D z ⟷
(∀x y. (x,y) ∈ D ⟶ ((x,y) ⦂ Ft(T) ∗ Fu(U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z (x,y) ⦂ F3 (T ∗ U)))›
definition ‹Separation_Homo⇩I⇩2 Ft Fu F3 T⇩1 T⇩2 U⇩1 U⇩2 D z ⟷
(∀x y. (x,y) ∈ D ⟶ ((x,y) ⦂ Ft T⇩1 T⇩2 ∗ Fu U⇩1 U⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z (x,y) ⦂ F3 (T⇩1 ∗ U⇩1) (T⇩2 ∗ U⇩2) ))›
definition Separation_Homo⇩E :: ‹
(('b::sep_magma,'a) φ ⇒ ('d::sep_magma_1,'c) φ)
⇒ (('b,'e) φ ⇒ ('d,'f) φ)
⇒ (('b, 'a × 'e) φ ⇒ ('d,'g) φ)
⇒ ('b,'a) φ ⇒ ('b,'e) φ ⇒ 'g set ⇒ ('g ⇒ 'c × 'f) ⇒ bool›
where ‹Separation_Homo⇩E Ft Fu F3 T U Du un ⟷
(∀z∈Du. z ⦂ F3 (T ∗ U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 un z ⦂ Ft T ∗ Fu U)›
definition ‹Separation_Homo⇩E⇩2 Ft Fu F3 T⇩1 T⇩2 U⇩1 U⇩2 Du un ⟷
(∀z∈Du. z ⦂ F3 (T⇩1 ∗ U⇩1) (T⇩2 ∗ U⇩2) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 un z ⦂ Ft T⇩1 T⇩2 ∗ Fu U⇩1 U⇩2) ›
definition Separation_Homo⇩I_Cond :: ‹
(('b::sep_magma_1,'a) φ ⇒ ('d::sep_magma_1,'c) φ)
⇒ (('b,'e) φ ⇒ ('d,'f) φ)
⇒ (('b, 'a × 'e) φ ⇒ ('d,'g) φ)
⇒ bool ⇒ ('b,'a) φ ⇒ ('b,'e) φ
⇒ ('c × 'f) set ⇒ ('c × 'f ⇒ 'g)
⇒ bool›
where ‹Separation_Homo⇩I_Cond Ft Fu F3 C⇩W T U D z ⟷
(∀x y. (x,y) ∈ D ⟶ ((x,y) ⦂ Ft T ∗ ◒[C⇩W] Fu U 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z (x,y) ⦂ F3 (T ∗ ◒[C⇩W] U)))›
definition ‹Separation_Homo⇩I⇩2_Cond Ft Fu F3 C⇩W T⇩1 T⇩2 U⇩1 U⇩2 D z ⟷
(∀x y. (x,y) ∈ D ⟶ ((x,y) ⦂ Ft T⇩1 T⇩2 ∗ ◒[C⇩W] Fu U⇩1 U⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z (x,y) ⦂ F3 (T⇩1 ∗ ◒[C⇩W] U⇩1) (T⇩2 ∗ ◒[C⇩W] U⇩2) ))›
definition Separation_Homo⇩E_Cond :: ‹
(('b::sep_magma_1,'a) φ ⇒ ('d::sep_magma_1,'c) φ)
⇒ (('b,'e) φ ⇒ ('d,'f) φ)
⇒ (('b, 'a × 'e) φ ⇒ ('d,'g) φ)
⇒ bool ⇒ ('b,'a) φ ⇒ ('b,'e) φ
⇒ 'g set ⇒ ('g ⇒ 'c × 'f) ⇒ bool›
where ‹Separation_Homo⇩E_Cond Ft Fu F3 C⇩R T U D un ⟷
(∀z. z ∈ D ⟶ (z ⦂ F3 (T ∗ ◒[C⇩R] U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 un z ⦂ Ft T ∗ ◒[C⇩R] Fu U))›
definition ‹Separation_Homo⇩E⇩2_Cond Ft Fu F3 C T⇩1 T⇩2 U⇩1 U⇩2 D un ⟷
(∀z. z ∈ D ⟶ (z ⦂ F3 (T⇩1 ∗ ◒[C] U⇩1) (T⇩2 ∗ ◒[C] U⇩2) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 un z ⦂ Ft T⇩1 T⇩2 ∗ ◒[C] Fu U⇩1 U⇩2 ))›
paragraph ‹With Parameter›
definition ‹Separation_Homo⇩Λ⇩I Ft Fu F3 T U D z ⟷
(∀x y. (x,y) ∈ D ⟶ ((x,y) ⦂ Ft(T) ∗ Fu(U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z (x,y) ⦂ F3 (λp. T p ∗ U p)))›
definition ‹Separation_Homo⇩Λ⇩E Ft Fu F3 T U Du un ⟷
(∀z∈Du. z ⦂ F3 (λp. T p ∗ U p) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 un z ⦂ Ft T ∗ Fu U)›
definition ‹Separation_Homo⇩Λ⇩I_Cond Ft Fu F3 C T U D z ⟷
(∀x y. (x,y) ∈ D ⟶ ((x,y) ⦂ Ft(T) ∗ ◒[C] Fu(U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z (x,y) ⦂ F3 (λp. T p ∗ ◒[C] U p)))›
definition ‹Separation_Homo⇩Λ⇩E_Cond Ft Fu F3 C T U D un ⟷
(∀z. z ∈ D ⟶ (z ⦂ F3 (λp. T p ∗ ◒[C] U p) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 un z ⦂ Ft T ∗ ◒[C] Fu U))›
subsubsection ‹Semimodule›
text ‹Convention: the domain ‹Dx› of object gives proof obligation but the domain ‹Ds› of scalar is
a reasoning guard. Recall the reasoning is guided by types, the reasoning should be determined
only by types, where a proof obligation about the objects are yielded as an outcome.
‹Dx› is totally about objects but ‹Ds› is about scalar and scalar is in type-level.
›
definition Module_Zero :: ‹('s ⇒ ('c::one,'a) φ) ⇒ 's ⇒ bool›
where ‹Module_Zero F zero ⟷ (∀x. (x ⦂ F zero) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 1)›
definition Closed_Module_Zero :: ‹('s ⇒ ('c::one,'a) φ) ⇒ 's ⇒ bool›
where ‹Closed_Module_Zero F zero ⟷ (∀x. (x ⦂ F zero) = 1)›
definition Module_One⇩I :: ‹('s ⇒ ('c,'a) φ)
⇒ ('c,'a⇩1) φ
⇒ 's ⇒ ('a⇩1 ⇒ bool) ⇒ ('a⇩1 ⇒ 'a) ⇒ ('a⇩1 ⇒ bool)
⇒ bool›
where ‹Module_One⇩I F T⇩1 one D f P ⟷ (∀x. D x ⟶ (x ⦂ T⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f x ⦂ F one 𝗐𝗂𝗍𝗁 P x))›
definition Module_One⇩E :: ‹('s ⇒ ('c,'a) φ)
⇒ ('c,'a⇩1) φ
⇒ 's ⇒ ('a ⇒ bool) ⇒ ('a ⇒ 'a⇩1) ⇒ ('a ⇒ bool)
⇒ bool›
where ‹Module_One⇩E F T⇩1 one D f P ⟷ (∀x. D x ⟶ (x ⦂ F one 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f x ⦂ T⇩1 𝗐𝗂𝗍𝗁 P x))›
definition Module_Assoc⇩I :: ‹ ('s⇩s ⇒ ('c⇩t,'a⇩t) φ ⇒ ('c⇩s⇩t,'a⇩s⇩_⇩t) φ)
⇒ ('s⇩t ⇒ ('c,'a) φ ⇒ ('c⇩t,'a⇩t) φ)
⇒ ('s⇩c ⇒ ('c,'a) φ ⇒ ('c⇩s⇩t,'a⇩s⇩t) φ)
⇒ ('c,'a) φ
⇒ ('s⇩s ⇒ bool)
⇒ ('s⇩t ⇒ bool)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 'a⇩s⇩_⇩t ⇒ bool)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 's⇩c)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 'a⇩s⇩_⇩t ⇒ 'a⇩s⇩t)
⇒ bool›
where ‹Module_Assoc⇩I Fs Ft Fc T Ds Dt Dx smul f
⟷ (∀s t x. Ds s ∧ Dt t ∧ Dx s t x ⟶ (x ⦂ Fs s (Ft t T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f s t x ⦂ Fc (smul s t) T))›
definition Module_Assoc⇩E :: ‹ ('s⇩s ⇒ ('c⇩t,'a⇩t) φ ⇒ ('c⇩s⇩t,'a⇩s⇩_⇩t) φ)
⇒ ('s⇩t ⇒ ('c,'a) φ ⇒ ('c⇩t,'a⇩t) φ)
⇒ ('s⇩c ⇒ ('c,'a) φ ⇒ ('c⇩s⇩t,'a⇩s⇩t) φ)
⇒ ('c,'a) φ
⇒ ('s⇩s ⇒ bool)
⇒ ('s⇩t ⇒ bool)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 'a⇩s⇩t ⇒ bool)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 's⇩c)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 'a⇩s⇩t ⇒ 'a⇩s⇩_⇩t)
⇒ bool›
where ‹Module_Assoc⇩E Fs Ft Fc T Ds Dt Dx smul f
⟷ (∀s t x. Ds s ∧ Dt t ∧ Dx s t x ⟶ (x ⦂ Fc (smul s t) T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f s t x ⦂ Fs s (Ft t T)))›
text ‹The extended scalar association operator for Finite Multiplicative Quantification is just uncurrying.›
definition Module_Assoc⇩Λ⇩I :: ‹ ('s⇩s ⇒ ('p⇩s ⇒ ('c⇩t,'a⇩t) φ) ⇒ ('c⇩s⇩t,'a⇩s⇩_⇩t) φ)
⇒ ('s⇩t ⇒ ('p⇩t ⇒ ('c,'a) φ) ⇒ ('c⇩t,'a⇩t) φ)
⇒ ('s⇩c ⇒ ('p⇩s × 'p⇩t ⇒ ('c,'a) φ) ⇒ ('c⇩s⇩t,'a⇩s⇩t) φ)
⇒ ('p⇩s ⇒ 'p⇩t ⇒ ('c,'a) φ)
⇒ ('s⇩s ⇒ bool)
⇒ ('s⇩t ⇒ bool)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 'a⇩s⇩_⇩t ⇒ bool)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 's⇩c)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 'a⇩s⇩_⇩t ⇒ 'a⇩s⇩t)
⇒ bool›
where ‹Module_Assoc⇩Λ⇩I Fs Ft Fc T Ds Dt Dx smul f
⟷ (∀s t x. Ds s ∧ Dt t ∧ Dx s t x ⟶ (x ⦂ Fs s (λp⇩s. Ft t (T p⇩s)) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f s t x ⦂ Fc (smul s t) (case_prod T)))›
definition Module_Assoc⇩Λ⇩E :: ‹ ('s⇩s ⇒ ('p⇩s ⇒ ('c⇩t,'a⇩t) φ) ⇒ ('c⇩s⇩t,'a⇩s⇩_⇩t) φ)
⇒ ('s⇩t ⇒ ('p⇩t ⇒ ('c,'a) φ) ⇒ ('c⇩t,'a⇩t) φ)
⇒ ('s⇩c ⇒ ('p⇩s × 'p⇩t ⇒ ('c,'a) φ) ⇒ ('c⇩s⇩t,'a⇩s⇩t) φ)
⇒ ('p⇩s × 'p⇩t ⇒ ('c,'a) φ)
⇒ ('s⇩s ⇒ bool)
⇒ ('s⇩t ⇒ bool)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 'a⇩s⇩_⇩t ⇒ bool)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 's⇩c)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 'a⇩s⇩_⇩t ⇒ 'a⇩s⇩t)
⇒ bool›
where ‹Module_Assoc⇩Λ⇩E Fs Ft Fc T Ds Dt Dx smul f
⟷ (∀s t x. Ds s ∧ Dt t ∧ Dx s t x ⟶ (f s t x ⦂ Fc (smul s t) T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ Fs s (λp⇩s. Ft t (λp⇩t. T (p⇩s, p⇩t)))))›
definition Module_Distr_Homo⇩Z :: ‹ ('s ⇒ ('c::sep_magma,'a) φ)
⇒ ('s::partial_add_magma ⇒ bool)
⇒ ('s ⇒ 's ⇒ 'a × 'a ⇒ bool)
⇒ ('s ⇒ 's ⇒ 'a × 'a ⇒ 'a)
⇒ bool›
where ‹Module_Distr_Homo⇩Z F Ds Dx z ⟷
(∀s t x. Ds s ∧ Ds t ∧ s ##⇩+ t ∧ Dx s t x ⟶ (x ⦂ F s ∗ F t 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z s t x ⦂ F (s + t) ))›
definition Module_Distr_Homo⇩Z_rev :: ‹('s ⇒ ('c::sep_magma,'a) φ)
⇒ ('s::partial_add_magma ⇒ bool)
⇒ ('s ⇒ 's ⇒ 'a × 'a ⇒ bool)
⇒ ('s ⇒ 's ⇒ 'a × 'a ⇒ 'a)
⇒ ('s ⇒ 's ⇒ 'a × 'a ⇒ bool)
⇒ ('s ⇒ 's ⇒ 'a × 'a ⇒ 'a)
⇒ bool›
where ‹Module_Distr_Homo⇩Z_rev F Ds Dx' z' Dx z ⟷
(Module_Distr_Homo⇩Z F Ds Dx' z' ⟶
(∀s t x. Ds s ∧ Ds t ∧ t ##⇩+ s ∧ Dx s t x ⟶
(x ⦂ F s ∗ F t 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z s t x ⦂ F (t + s) )))›
definition Module_Distr_Homo⇩S :: ‹('s ⇒ ('c::sep_magma,'a) φ)
⇒ ('s::partial_add_magma ⇒ bool)
⇒ ('s ⇒ 's ⇒ 'a ⇒ bool)
⇒ ('s ⇒ 's ⇒ 'a ⇒ 'a × 'a)
⇒ bool›
where ‹Module_Distr_Homo⇩S F Ds Dx uz ⟷
(∀s t x. Ds s ∧ Ds t ∧ s ##⇩+ t ∧ Dx s t x ⟶
(x ⦂ F (s + t) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 uz s t x ⦂ F s ∗ F t ))›
definition Module_Distr_Homo⇩S_rev :: ‹('s ⇒ ('c::sep_magma,'a) φ)
⇒ ('s ⇒ 's ⇒ 'a ⇒ bool)
⇒ ('s ⇒ 's ⇒ 'a ⇒ 'a × 'a)
⇒ ('s::partial_add_magma ⇒ bool)
⇒ ('s ⇒ 's ⇒ 'a ⇒ bool)
⇒ ('s ⇒ 's ⇒ 'a ⇒ 'a × 'a)
⇒ bool›
where ‹Module_Distr_Homo⇩S_rev F Dx' uz' Ds Dx uz ⟷
(Module_Distr_Homo⇩S F Ds Dx' uz' ⟶
(∀s t x. Ds s ∧ Ds t ∧ t ##⇩+ s ∧ Dx s t x ⟶
(x ⦂ F (t + s) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 uz s t x ⦂ F s ∗ F t )))›
definition Semimodule_No_SDistr :: ‹'a ⇒ bool›
where ‹Semimodule_No_SDistr F ≡ True›
subsubsection ‹Commutativity between φ-Type Operators›
text ‹‹Separation_Homo› is a special case of the commutativity to ‹∗›.›
text ‹The properties are all given in relationform, while functional version can be obtained by
and should be represented in \<^term>‹embedded_func› which prevents over-simplification
(e.g., when ‹P = (λx. True)›)›
paragraph ‹Unary-to-Unary›
definition Tyops_Commute :: ‹ (('c⇩G,'a⇩G) φ ⇒ ('c,'a) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩F,'a⇩F) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩G,'a⇩G) φ)
⇒ (('c⇩F,'a⇩F) φ ⇒ ('c,'b) φ)
⇒ ('c⇩T,'a⇩T) φ
⇒ ('a ⇒ bool)
⇒ ('a ⇒ 'b ⇒ bool)
⇒ bool›
where ‹Tyops_Commute F F' G G' T D r ⟷
(∀x. D x ⟶ (x ⦂ F (G T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (F' T) 𝗌𝗎𝖻𝗃 y. r x y))›
paragraph ‹Unary-to-Binary›
definition Tyops_Commute⇩1⇩_⇩2 :: ‹ (('c⇩G,'a⇩G) φ ⇒ ('c,'a) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩F⇩T,'a⇩F⇩T) φ)
⇒ (('c⇩U,'a⇩U) φ ⇒ ('c⇩F⇩U,'a⇩F⇩U) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩U,'a⇩U) φ ⇒ ('c⇩G,'a⇩G) φ)
⇒ (('c⇩F⇩T,'a⇩F⇩T) φ ⇒ ('c⇩F⇩U,'a⇩F⇩U) φ ⇒ ('c,'b) φ)
⇒ ('c⇩T,'a⇩T) φ
⇒ ('c⇩U,'a⇩U) φ
⇒ ('a ⇒ bool)
⇒ ('a ⇒ 'b ⇒ bool)
⇒ bool›
where ‹Tyops_Commute⇩1⇩_⇩2 F F'⇩T F'⇩U G G' T U D r ⟷
(∀x. D x ⟶ (x ⦂ F (G T U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (F'⇩T T) (F'⇩U U) 𝗌𝗎𝖻𝗃 y. r x y))›
paragraph ‹Binary-to-Unary›
definition Tyops_Commute⇩2⇩_⇩1 :: ‹ (('c⇩G,'a⇩G) φ ⇒ ('c,'a) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩F⇩T,'a⇩F⇩T) φ)
⇒ (('c⇩U,'a⇩U) φ ⇒ ('c⇩F⇩U,'a⇩F⇩U) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩U,'a⇩U) φ ⇒ ('c⇩G,'a⇩G) φ)
⇒ (('c⇩F⇩T,'a⇩F⇩T) φ ⇒ ('c⇩F⇩U,'a⇩F⇩U) φ ⇒ ('c,'b) φ)
⇒ ('c⇩T,'a⇩T) φ
⇒ ('c⇩U,'a⇩U) φ
⇒ ('b ⇒ bool)
⇒ ('b ⇒ 'a ⇒ bool)
⇒ bool›
where ‹Tyops_Commute⇩2⇩_⇩1 F F'⇩T F'⇩U G G' T U D r ⟷
(∀x. D x ⟶ (x ⦂ G' (F'⇩T T) (F'⇩U U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F (G T U) 𝗌𝗎𝖻𝗃 y. r x y))›
paragraph ‹Over Parameterized Types›
definition Tyops_Commute⇩Λ⇩I :: ‹ (('c⇩G,'a⇩G) φ ⇒ ('c,'a) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩F,'a⇩F) φ)
⇒ (('p ⇒ ('c⇩T,'a⇩T) φ) ⇒ ('c⇩G,'a⇩G) φ)
⇒ (('p ⇒ ('c⇩F,'a⇩F) φ) ⇒ ('c,'b) φ)
⇒ ('p ⇒ ('c⇩T,'a⇩T) φ)
⇒ ('a ⇒ bool)
⇒ ('a ⇒ 'b ⇒ bool)
⇒ bool›
where ‹ Tyops_Commute⇩Λ⇩I F F' G G' T D r ⟷
(∀x. D x ⟶ (x ⦂ F (G T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (λp. F' (T p)) 𝗌𝗎𝖻𝗃 y. r x y)) ›
definition Tyops_Commute⇩Λ⇩E :: ‹ (('p ⇒ ('c⇩G,'a⇩G) φ) ⇒ ('c,'a) φ)
⇒ (('p ⇒ ('c⇩T,'a⇩T) φ) ⇒ ('c⇩F,'a⇩F) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩G,'a⇩G) φ)
⇒ (('c⇩F,'a⇩F) φ ⇒ ('c,'b) φ)
⇒ ('p ⇒ ('c⇩T,'a⇩T) φ)
⇒ ('a ⇒ bool)
⇒ ('a ⇒ 'b ⇒ bool)
⇒ bool›
where ‹ Tyops_Commute⇩Λ⇩E F F' G G' T D r ⟷
(∀x. D x ⟶ (x ⦂ F (λp. G (T p)) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (F' T) 𝗌𝗎𝖻𝗃 y. r x y)) ›
subsection ‹Conventions›
subsubsection ‹General Groups of Properties›
φreasoner_group φtype_algebra_all_properties = (100, [0,4000]) for ‹_›
‹The universe group containing every sort of φ-type algebraic properties›
and φTA_system_bottom = (1, [0,19]) for ‹_› in φtype_algebra_all_properties
‹Systematic rules of φ-type algebraic properties, of the lowest priority.›
and φTA_fallback_lattice = (14, [10,19]) for ‹_› in φTA_system_bottom
‹Rules of φ-type algebraic forming a lattice giving fallbacks from weak properties to strong properties›
and φtype_algebra_properties = (100, [20, 3800]) for ‹_› in φtype_algebra_all_properties
and > φTA_system_bottom
‹User rules of φ-type algebraic properties›
and φTA_property = (1000, [1000, 1030]) for ‹_› in φtype_algebra_properties
‹Cutting rules›
and φTA_derived_properties = (50, [50,50]) for ‹_› in φtype_algebra_properties
‹Automatically derived properties.›
and φTA_varify_out = (3900, [3900,3900]) for ‹_› in φtype_algebra_all_properties and > φtype_algebra_properties
‹Systematic rules of φ-type algebraic properties that varifies OUT arguments that are not varibales›
and φTA_commutativity = (100, [20, 3800]) for (‹Tyops_Commute F F' G G' T D r›,
‹Tyops_Commute⇩1⇩_⇩2 F F'⇩T F'⇩U G G' T U D r›,
‹Tyops_Commute⇩2⇩_⇩1 F F'⇩T F'⇩U G G' T U D r›)
in φtype_algebra_properties
‹commutativities›
and φTA_commutativity_default = (100, [100, 100]) in φTA_commutativity
‹rules not assigned with a specific priority and group›
and φTA_derived_commutativity = (50,[50,50]) in φTA_commutativity and in φTA_derived_properties
‹commutativities. Note, because Tyops_Commute is also a tempalte property which may trigger
instantiation of a lot templates. The deriviation should be prudent, which may provide templates
to allow users to manually instantiation but registering to the φ-LPR only when the instantiated
commutativity is certainly correct, because user overridings cannot override the rules
instantiated by the derived commutativity to be overrided. ›
subsubsection ‹Groups for Specific Properties›
φreasoner_group Object_Sep_Homo_functor = (50, [50,50]) for (‹Object_Sep_Homo⇩I T D›, ‹Object_Sep_Homo⇩E T›)
in φtype_algebra_properties
‹Object_Sep_Homo for functors›
subsubsection ‹Derived Rules›
φreasoner_group deriving_local_rules = (200, [180,220]) for ‹_› > default
‹Local reasoning rules such as those extracted from induction hypotheses used during deriving.›
and ToA_derived_one_to_one_functor = (70, [70,70]) for ‹x ⦂ F(T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f(x) ⦂ F(U)› in ToA_derived
‹Derived transformation in form ‹x ⦂ F(T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f(x) ⦂ F(U)›, of a high priority as this is what
should be attempted in reasoning.›
and To_ToA_derived_Tr_functor = (60, [60,60]) for ‹x ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ U 𝗌𝗎𝖻𝗃 y. r x y 𝗐𝗂𝗍𝗁 P @tag to U›
in To_ToA_derived
‹Derived To-Transformation rules for transformation functor›
and To_ToA_derived_Tr_functor_fuzzy = (55, [55,55]) for ‹x ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ U 𝗌𝗎𝖻𝗃 y. r x y 𝗐𝗂𝗍𝗁 P @tag to U›
in To_ToA_derived and < To_ToA_derived_Tr_functor
‹when the annotated target φ-type is in the element algebra but not the container›
and To_ToA_derived_to_raw = (60, [60,60]) for ‹x ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Itself 𝗌𝗎𝖻𝗃 y. r x y 𝗐𝗂𝗍𝗁 P @tag to Itself›
in To_ToA_derived
‹Derived To-Transformation openning down the raw concrete representation›
and φsimp_derived_Tr_functor = (40, [40,45]) for ‹X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P @tag 𝒜simp›
in φsimp_derived
‹Derived transformation-based simplification for transformation functor›
and φsimp_derived_bubbling = (60, [60,61]) for ‹x ⦂ F (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 G T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 YY @tag 𝒜simp›
‹Derived transformation-based simplification about bubbling›
and derived_SE_functor = (70, [70,70]) for ‹x ⦂ F(T) ✼ F(W) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f(x) ⦂ F(U) ✼ F(R)› in ToA_derived
‹Derived rules of Separation Extraction, of a high priority as this is what
should be attempted in reasoning. No confliction with %ToA_derived_one_to_one_functor›
φreasoner_group_assert identity_element_ToA < deriving_local_rules
paragraph ‹Separation Extraction on Semimodule›
φreasoner_group derived_SE_scalar_assoc = (30, [30,30]) for ‹x ⦂ F (a * b) T ✼ F (a * b) W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F (c*d) U ✼ F (c*d) R›
in ToA_derived and < derived_SE_functor
‹Derived rules for scalar associativity, of a low priority as it can conflict to scalar distributive rule,
see \cref{Semimodule-Scalar-Associative}›
and derived_SE_scalar_distr = (35, [31, 39]) for ‹x ⦂ F (a + b) T ✼ F (a + b) W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F (c+d) U ✼ F (c+d) R›
in ToA_derived and > derived_SE_scalar_assoc and < derived_SE_functor
‹Derived rules for scalar distributivity.›
and derived_SE_sdistr_comm_no_adz = (39, [39, 39]) in derived_SE_scalar_distr
‹scalar distributivity on commutative semigroup and non-zero scalar›
and derived_SE_sdistr = (37, [37, 38]) in derived_SE_scalar_distr < derived_SE_sdistr_comm_no_adz
‹Derived rules for scalar distributivity on commutative semigroup›
and derived_SE_sdistr_noassoc = (33, [33, 33]) in derived_SE_scalar_distr < derived_SE_sdistr
‹Derived rules for scalar distributivity on separational magma›
and derived_SE_red_scalar_one = (30, [30,30]) for (‹x ⦂ F one T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ U›, ‹y ⦂ U 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ F one T›)
in ToA_derived and < derived_SE_sdistr_noassoc
‹reduce scalar one›
and derived_SE_inj_to_module = (27, [27,28]) for (‹x ⦂ F one T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ U›, ‹y ⦂ U 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ F one T›)
in ToA_derived and < derived_SE_red_scalar_one
‹Derived rules lifting the target part into the module operator ‹F››
and To_ToA_derived_SAssoc = (61, [61,61])
for (‹x ⦂ F st T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F s (F t T) 𝗌𝗎𝖻𝗃 y. r y @tag to (𝗌𝗉𝗅𝗂𝗍-𝖺𝗌𝗌𝗈𝖼 s t)›)
in To_ToA_derived
‹splitting a module by associativity›
and To_ToA_derived_SDistri = (61, [61,61])
for (‹x ⦂ F st T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F t T ∗ F s T 𝗌𝗎𝖻𝗃 y. r y @tag to (𝗌𝗉𝗅𝗂𝗍-𝗌𝖼𝖺𝗅𝖺𝗋 s t)›)
in To_ToA_derived
‹splitting a module by scalar distributivity›
subsubsection ‹Configurations›
φreasoner_group Semimodule_No_SDistr = (1000, [1000,1000]) for ‹Semimodule_No_SDistr F› ‹›
and Transformation_Functor = (1000, [1000,1000]) in φTA_property ‹›
and Separation_Homo = (1000, [1000,1000]) in φTA_property ‹›
and Module_One = (1000, [1000,1000]) in φTA_property ‹›
and Module_Zero = (1000, [1000,1000]) in φTA_property ‹›
and Module_Assoc = (1000, [1000,1000]) in φTA_property ‹›
and Module_Distr = (1000, [1000,1000]) in φTA_property ‹›
declare [[
φdefault_reasoner_group
‹Tyops_Commute F F' G G' T D R› : %φTA_commutativity_default (100)
‹Tyops_Commute⇩1⇩_⇩2 F F'⇩T F'⇩U G G' T U D r› : %φTA_commutativity_default (100)
‹Tyops_Commute⇩2⇩_⇩1 F F'⇩T F'⇩U G G' T U D r› : %φTA_commutativity_default (100)
‹Tyops_Commute⇩Λ⇩I F F' G G' T D r› : %φTA_commutativity_default (100)
‹Tyops_Commute⇩Λ⇩E F F' G G' T D r› : %φTA_commutativity_default (100)
‹Transformation_Functor F1 F2 T U D R mapper› : %Transformation_Functor (100)
‹Functional_Transformation_Functor Fa Fb T U D R pm fm› : %Transformation_Functor (100)
‹Transformation_BiFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 m› : %Transformation_Functor (100)
‹Functional_Transformation_BiFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 pm fm› : %Transformation_Functor (100)
‹Transformation_Functor⇩Λ F1 F2 T U D R m› : %Transformation_Functor (100)
‹Functional_Transformation_Functor⇩Λ Fa Fb T U D R pm fm› : %Transformation_Functor (100)
‹CV_TrFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 mapper› : %Transformation_Functor (100)
‹Fun_CV_TrFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 FC⇩1 R⇩2 pm fm› : %Transformation_Functor (100)
‹Separation_Homo⇩I Ft Fu F3 T U D z› : %Separation_Homo (100)
‹Separation_Homo⇩I⇩2 Ft Fu F3 T⇩1 T⇩2 U⇩1 U⇩2 D z› : %Separation_Homo (100)
‹Separation_Homo⇩E Ft Fu F3 T U Du un› : %Separation_Homo (100)
‹Separation_Homo⇩E⇩2 Ft Fu F3 T⇩1 T⇩2 U⇩1 U⇩2 Du un› : %Separation_Homo (100)
‹Separation_Homo⇩Λ⇩I Ft Fu F3 T U D z› : %Separation_Homo (100)
‹Separation_Homo⇩Λ⇩E Ft Fu F3 T U Du un› : %Separation_Homo (100)
‹Module_Zero F zero› : %Module_Zero (100)
‹Closed_Module_Zero F zero› : %Module_Zero (100)
‹Module_One⇩I F T⇩1 one D f P› : %Module_One (100)
‹Module_One⇩E F T⇩1 one D f P› : %Module_One (100)
‹Module_Assoc⇩I Fs Ft Fc T Ds Dt Dx smul f› : %Module_Assoc (100)
‹Module_Assoc⇩E Fs Ft Fc T Ds Dt Dx smul f› : %Module_Assoc (100)
‹Module_Assoc⇩Λ⇩I Fs Ft Fc T Ds Dt Dx smul f› : %Module_Assoc (100)
‹Module_Assoc⇩Λ⇩E Fs Ft Fc T Ds Dt Dx smul f› : %Module_Assoc (100)
‹Module_Distr_Homo⇩Z F Ds Dx z› : %Module_Distr (100)
‹Module_Distr_Homo⇩S F Ds Dx uz› : %Module_Distr (100)
]]
declare [[
φpremise_attribute once? [φreason? %local] for ‹Transformation_Functor _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Functional_Transformation_Functor _ _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Transformation_Functor⇩Λ _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Functional_Transformation_Functor⇩Λ _ _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Transformation_BiFunctor _ _ _ _ _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Functional_Transformation_BiFunctor _ _ _ _ _ _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹CV_TrFunctor _ _ _ _ _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Fun_CV_TrFunctor _ _ _ _ _ _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹CV_TrFunctor _ _ _ _ _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Fun_CV_TrFunctor _ _ _ _ _ _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Object_Sep_Homo⇩I _ _ › (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Object_Sep_Homo⇩E _ › (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Separation_Homo⇩I _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Separation_Homo⇩I⇩2 _ _ _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Separation_Homo⇩E _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Separation_Homo⇩E⇩2 _ _ _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Separation_Homo⇩I_Cond _ _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Separation_Homo⇩I⇩2_Cond _ _ _ _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Separation_Homo⇩E_Cond _ _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Separation_Homo⇩E⇩2_Cond _ _ _ _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Module_Zero _ _ › (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Closed_Module_Zero _ _ › (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Module_One⇩I _ _ _ _ _ _ › (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Module_One⇩E _ _ _ _ _ _ › (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Module_Assoc⇩I _ _ _ _ _ _ _ _ _ › (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Module_Assoc⇩E _ _ _ _ _ _ _ _ _ › (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Module_Distr_Homo⇩Z _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Module_Distr_Homo⇩Z_rev _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Module_Distr_Homo⇩S _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Module_Distr_Homo⇩S_rev _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Tyops_Commute _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Tyops_Commute⇩Λ⇩I _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Tyops_Commute⇩Λ⇩E _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Tyops_Commute⇩1⇩_⇩2 _ _ _ _ _ _ _ _ _› (%φattr),
φpremise_attribute once? [φreason? %local] for ‹Tyops_Commute⇩2⇩_⇩1 _ _ _ _ _ _ _ _ _› (%φattr),
φreason_default_pattern
‹Transformation_Functor ?Fa ?Fb _ _ _ _ _› ⇒
‹Transformation_Functor ?Fa _ _ _ _ _ _›
‹Transformation_Functor _ ?Fb _ _ _ _ _› (100)
and ‹Functional_Transformation_Functor ?Fa ?Fb _ _ _ _ _ _› ⇒
‹Functional_Transformation_Functor ?Fa _ _ _ _ _ _ _›
‹Functional_Transformation_Functor _ ?Fb _ _ _ _ _ _› (100)
and ‹Transformation_Functor⇩Λ ?Fa ?Fb _ _ _ _ _› ⇒
‹Transformation_Functor⇩Λ ?Fa _ _ _ _ _ _›
‹Transformation_Functor⇩Λ _ ?Fb _ _ _ _ _› (100)
and ‹Functional_Transformation_Functor⇩Λ ?Fa ?Fb _ _ _ _ _ _› ⇒
‹Functional_Transformation_Functor⇩Λ ?Fa _ _ _ _ _ _ _›
‹Functional_Transformation_Functor⇩Λ _ ?Fb _ _ _ _ _ _› (100)
and ‹Transformation_BiFunctor ?Fa ?Fb _ _ _ _ _ _ _ _ _› ⇒
‹Transformation_BiFunctor ?Fa _ _ _ _ _ _ _ _ _ _›
‹Transformation_BiFunctor _ ?Fb _ _ _ _ _ _ _ _ _› (100)
and ‹Functional_Transformation_BiFunctor ?Fa ?Fb _ _ _ _ _ _ _ _ _ _ › ⇒
‹Functional_Transformation_BiFunctor ?Fa _ _ _ _ _ _ _ _ _ _ _›
‹Functional_Transformation_BiFunctor _ ?Fb _ _ _ _ _ _ _ _ _ _› (100)
and ‹CV_TrFunctor ?Fa ?Fb _ _ _ _ _ _ _ _ _› ⇒
‹CV_TrFunctor ?Fa _ _ _ _ _ _ _ _ _ _›
‹CV_TrFunctor _ ?Fb _ _ _ _ _ _ _ _ _› (100)
and ‹Fun_CV_TrFunctor ?Fa ?Fb _ _ _ _ _ _ _ _ _ _ › ⇒
‹Fun_CV_TrFunctor ?Fa _ _ _ _ _ _ _ _ _ _ _›
‹Fun_CV_TrFunctor _ ?Fb _ _ _ _ _ _ _ _ _ _› (100)
and ‹Separation_Homo⇩I ?Ft ?Fu ?Fc _ _ _ _› ⇒
‹Separation_Homo⇩I ?Ft _ _ _ _ _ _›
‹Separation_Homo⇩I _ ?Fu _ _ _ _ _›
‹Separation_Homo⇩I _ _ ?Fc _ _ _ _› (100)
and ‹Separation_Homo⇩I⇩2 ?Ft ?Fu ?Fc _ _ _ _ _ _› ⇒
‹Separation_Homo⇩I⇩2 ?Ft _ _ _ _ _ _ _ _›
‹Separation_Homo⇩I⇩2 _ ?Fu _ _ _ _ _ _ _›
‹Separation_Homo⇩I⇩2 _ _ ?Fc _ _ _ _ _ _› (100)
and ‹Separation_Homo⇩E ?Ft ?Fu ?Fc _ _ _ _› ⇒
‹Separation_Homo⇩E _ _ ?Fc _ _ _ _›
‹Separation_Homo⇩E _ ?Fu _ _ _ _ _›
‹Separation_Homo⇩E ?Ft _ _ _ _ _ _› (100)
and ‹Separation_Homo⇩E⇩2 ?Ft ?Fu ?Fc _ _ _ _ _ _› ⇒
‹Separation_Homo⇩E⇩2 ?Ft _ _ _ _ _ _ _ _›
‹Separation_Homo⇩E⇩2 _ ?Fu _ _ _ _ _ _ _›
‹Separation_Homo⇩E⇩2 _ _ ?Fc _ _ _ _ _ _› (100)
and ‹Separation_Homo⇩Λ⇩I ?Ft ?Fu ?Fc _ _ _ _› ⇒
‹Separation_Homo⇩Λ⇩I ?Ft _ _ _ _ _ _›
‹Separation_Homo⇩Λ⇩I _ ?Fu _ _ _ _ _›
‹Separation_Homo⇩Λ⇩I _ _ ?Fc _ _ _ _› (100)
and ‹Separation_Homo⇩Λ⇩E ?Ft ?Fu ?Fc _ _ _ _› ⇒
‹Separation_Homo⇩Λ⇩E ?Ft _ _ _ _ _ _›
‹Separation_Homo⇩Λ⇩E _ ?Fu _ _ _ _ _›
‹Separation_Homo⇩Λ⇩E _ _ ?Fc _ _ _ _› (100)
and ‹Object_Sep_Homo⇩I ?T _› ⇒ ‹Object_Sep_Homo⇩I ?T _› (100)
and ‹Separation_Homo⇩I_Cond ?Ft ?Fu ?Fc _ _ _ _ _› ⇒
‹Separation_Homo⇩I_Cond ?Ft _ _ _ _ _ _ _›
‹Separation_Homo⇩I_Cond _ ?Fu _ _ _ _ _ _›
‹Separation_Homo⇩I_Cond _ _ ?Fc _ _ _ _ _› (100)
and ‹Separation_Homo⇩I⇩2_Cond ?Ft ?Fu ?Fc _ _ _ _ _ _ _› ⇒
‹Separation_Homo⇩I⇩2_Cond ?Ft _ _ _ _ _ _ _ _ _›
‹Separation_Homo⇩I⇩2_Cond _ ?Fu _ _ _ _ _ _ _ _›
‹Separation_Homo⇩I⇩2_Cond _ _ ?Fc _ _ _ _ _ _ _› (100)
and ‹Separation_Homo⇩E_Cond ?Ft ?Fu ?Fc _ _ _ _ _› ⇒
‹Separation_Homo⇩E_Cond ?Ft _ _ _ _ _ _ _›
‹Separation_Homo⇩E_Cond _ ?Fu _ _ _ _ _ _›
‹Separation_Homo⇩E_Cond _ _ ?Fc _ _ _ _ _› (100)
and ‹Separation_Homo⇩E⇩2_Cond ?Ft ?Fu ?Fc _ _ _ _ _ _ _› ⇒
‹Separation_Homo⇩E⇩2_Cond ?Ft _ _ _ _ _ _ _ _ _›
‹Separation_Homo⇩E⇩2_Cond _ ?Fu _ _ _ _ _ _ _ _›
‹Separation_Homo⇩E⇩2_Cond _ _ ?Fc _ _ _ _ _ _ _› (100)
and ‹Separation_Homo⇩Λ⇩I_Cond ?Ft ?Fu ?Fc _ _ _ _ _› ⇒
‹Separation_Homo⇩Λ⇩I_Cond ?Ft _ _ _ _ _ _ _›
‹Separation_Homo⇩Λ⇩I_Cond _ ?Fu _ _ _ _ _ _›
‹Separation_Homo⇩Λ⇩I_Cond _ _ ?Fc _ _ _ _ _› (100)
and ‹Separation_Homo⇩Λ⇩E_Cond ?Ft ?Fu ?Fc _ _ _ _ _› ⇒
‹Separation_Homo⇩Λ⇩E_Cond ?Ft _ _ _ _ _ _ _›
‹Separation_Homo⇩Λ⇩E_Cond _ ?Fu _ _ _ _ _ _›
‹Separation_Homo⇩Λ⇩E_Cond _ _ ?Fc _ _ _ _ _› (100)
and ‹Module_Distr_Homo⇩Z ?F _ _ _› ⇒ ‹Module_Distr_Homo⇩Z ?F _ _ _› (100)
and ‹Module_Distr_Homo⇩S ?F _ _ _› ⇒ ‹Module_Distr_Homo⇩S ?F _ _ _› (100)
and ‹Module_Distr_Homo⇩Z_rev ?F _ _ _ _ _› ⇒ ‹Module_Distr_Homo⇩Z_rev ?F _ _ _ _ _› (100)
and ‹Module_Distr_Homo⇩S_rev ?F _ _ _ _ _› ⇒ ‹Module_Distr_Homo⇩S_rev ?F _ _ _ _ _› (100)
and ‹Semimodule_No_SDistr ?F› ⇒ ‹Semimodule_No_SDistr ?F› (100)
and ‹Tyops_Commute ?F _ ?G _ ?T _ _› ⇒ ‹Tyops_Commute ?F _ ?G _ ?T _ _› (100)
and ‹Tyops_Commute⇩Λ⇩I ?F _ ?G _ ?T _ _› ⇒ ‹Tyops_Commute⇩Λ⇩I ?F _ ?G _ ?T _ _› (100)
and ‹Tyops_Commute⇩Λ⇩E ?F _ ?G _ ?T _ _› ⇒ ‹Tyops_Commute⇩Λ⇩E ?F _ ?G _ ?T _ _› (100)
and ‹Tyops_Commute⇩1⇩_⇩2 ?F _ _ ?G _ ?T ?U _ _› ⇒
‹Tyops_Commute⇩1⇩_⇩2 ?F _ _ ?G _ ?T ?U _ _› (100)
and ‹Tyops_Commute⇩2⇩_⇩1 ?F _ _ ?G _ ?T ?U _ _› ⇒
‹Tyops_Commute⇩2⇩_⇩1 ?F _ _ ?G _ ?T ?U _ _› (100)
]]
paragraph ‹Configuring Property Data Base›
setup ‹
let fun attach_var F =
let val i = maxidx_of_term F + 1
in case fastype_of F of \<^Type>‹fun T _› => F $ Var(("uu",i),T)
| _ => error "Impossible #8da16473-84ef-4bd8-9a96-331bcff88011"
end
open PLPR_Template_Properties
in add_property_kinds [
\<^pattern_prop>‹Transformation_Functor _ _ _ _ _ _ _›,
\<^pattern_prop>‹Functional_Transformation_Functor _ _ _ _ _ _ _ _›,
\<^pattern_prop>‹Transformation_Functor⇩Λ _ _ _ _ _ _ _›,
\<^pattern_prop>‹Functional_Transformation_Functor⇩Λ _ _ _ _ _ _ _ _›,
\<^pattern_prop>‹Transformation_BiFunctor _ _ _ _ _ _ _ _ _ _ _›,
\<^pattern_prop>‹Functional_Transformation_BiFunctor _ _ _ _ _ _ _ _ _ _ _ _›,
\<^pattern_prop>‹CV_TrFunctor _ _ _ _ _ _ _ _ _ _ _›,
\<^pattern_prop>‹Fun_CV_TrFunctor _ _ _ _ _ _ _ _ _ _ _ _›,
\<^pattern_prop>‹Separation_Homo⇩I _ _ _ _ _ _ _›,
\<^pattern_prop>‹Separation_Homo⇩I⇩2 _ _ _ _ _ _ _ _ _›,
\<^pattern_prop>‹Separation_Homo⇩E _ _ _ _ _ _ _›,
\<^pattern_prop>‹Separation_Homo⇩E⇩2 _ _ _ _ _ _ _ _ _›,
\<^pattern_prop>‹Separation_Homo⇩I_Cond _ _ _ _ _ _ _ _›,
\<^pattern_prop>‹Separation_Homo⇩I⇩2_Cond _ _ _ _ _ _ _ _ _ _›,
\<^pattern_prop>‹Separation_Homo⇩E_Cond _ _ _ _ _ _ _ _›,
\<^pattern_prop>‹Separation_Homo⇩E⇩2_Cond _ _ _ _ _ _ _ _ _ _›,
\<^pattern_prop>‹Separation_Homo⇩Λ⇩I _ _ _ _ _ _ _›,
\<^pattern_prop>‹Separation_Homo⇩Λ⇩E _ _ _ _ _ _ _›,
\<^pattern_prop>‹Separation_Homo⇩Λ⇩I_Cond _ _ _ _ _ _ _ _›,
\<^pattern_prop>‹Separation_Homo⇩Λ⇩E_Cond _ _ _ _ _ _ _ _›,
\<^pattern_prop>‹Closed_Module_Zero _ _›,
\<^pattern_prop>‹Module_Zero _ _›,
\<^pattern_prop>‹Module_One⇩I _ _ _ _ _ _›,
\<^pattern_prop>‹Module_One⇩E _ _ _ _ _ _›,
\<^pattern_prop>‹Module_Assoc⇩I _ _ _ _ _ _ _ _ _›,
\<^pattern_prop>‹Module_Assoc⇩E _ _ _ _ _ _ _ _ _›,
\<^pattern_prop>‹Module_Distr_Homo⇩Z _ _ _ _›,
\<^pattern_prop>‹Module_Distr_Homo⇩S _ _ _ _›,
\<^pattern_prop>‹Semimodule_No_SDistr _›,
\<^pattern_prop>‹Tyops_Commute _ _ _ _ _ _ _›,
\<^pattern_prop>‹Tyops_Commute⇩Λ⇩I _ _ _ _ _ _ _›,
\<^pattern_prop>‹Tyops_Commute⇩Λ⇩E _ _ _ _ _ _ _›,
\<^pattern_prop>‹Tyops_Commute⇩1⇩_⇩2 _ _ _ _ _ _ _ _ _›,
\<^pattern_prop>‹Tyops_Commute⇩2⇩_⇩1 _ _ _ _ _ _ _ _ _›
]
end
›
setup ‹
PLPR_Template_Properties.add_property_kinds [
\<^pattern_prop>‹TERM (Identity_Elements⇩I _)›,
\<^pattern_prop>‹TERM (Identity_Elements⇩E _)›
]
›
declare [[
φreason_default_pattern ‹TERM (Identity_Elements⇩I ?F)› ⇒ ‹TERM (Identity_Elements⇩I ?FF)› (100)
and ‹TERM (Identity_Elements⇩E ?F)› ⇒ ‹TERM (Identity_Elements⇩E ?FF)› (100)
]]
text ‹Candidates of templates instantiation are not prioritized. When a property requires multiple
rules ordered by their priorities for overrides and optimizations, the property is not declared
as a parameter property in the template instantiation system but just a φ-LPR reasoning goal tagged
by ‹𝒜_template_reason› in the template.
Instead, a trigger ‹TERM (The_Property F)› is used as the parameter property activating
the instantiation and (when the trigger is given) indicating when the prioritized rules are all given
so when can the instantiation start. ›
subsection ‹Direct Applications \& Properties›
text ‹Directly applying the algebraic properties.›
subsubsection ‹Transformation Functor›
lemma Transformation_Functor_sub_dom:
‹ (⋀x. Da x ⊆ Db x)
⟹ Transformation_Functor F1 F2 T U Da R mapper
⟹ Transformation_Functor F1 F2 T U Db R mapper›
unfolding Transformation_Functor_def
by (clarsimp simp add: subset_iff; blast)
lemma Transformation_Functor_sub_rng:
‹ (⋀x. Rb x ⊆ Ra x)
⟹ Transformation_Functor F1 F2 T U D Ra mapper
⟹ Transformation_Functor F1 F2 T U D Rb mapper›
unfolding Transformation_Functor_def
by (clarsimp simp add: subset_iff; blast)
lemma Transformation_Functor_sub_mapper:
‹ ma ≤ mb
⟹ Transformation_Functor F1 F2 T U D R ma
⟹ Transformation_Functor F1 F2 T U D R mb›
unfolding Transformation_Functor_def
by (clarsimp simp add: le_fun_def Transformation_def Ball_def, blast)
lemma apply_Transformation_Functor:
‹ Transformation_Functor Fa Fb T U D R mapper
⟹ (⋀a. 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 a ∈ D x ⟹ a ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U 𝗌𝗎𝖻𝗃 b. g a b)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀a b. a ∈ D x ∧ g a b ⟶ b ∈ R x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U 𝗌𝗎𝖻𝗃 y. mapper g x y ›
unfolding Transformation_Functor_def Premise_def
by simp
lemma apply_Functional_Transformation_Functor:
‹ Functional_Transformation_Functor Fa Fb T U D R pred_mapper func_mapper
⟹ (⋀a ∈ D x. 𝗎𝗌𝖾𝗋 a ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f a ⦂ U 𝗐𝗂𝗍𝗁 P a)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀a. a ∈ D x ⟶ f a ∈ R x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 func_mapper f P x ⦂ Fb U 𝗐𝗂𝗍𝗁 pred_mapper f P x›
unfolding meta_Ball_def Argument_def Premise_def
Functional_Transformation_Functor_def Transformation_Functor_def
by clarsimp
subsubsection ‹Transformation Bi-Functor›
lemma Transformation_BiFunctor_sub_dom:
‹ (⋀x. D⇩1 x ⊆ D⇩1' x)
⟹ (⋀x. D⇩2 x ⊆ D⇩2' x)
⟹ Transformation_BiFunctor F1 F2 T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 mapper
⟹ Transformation_BiFunctor F1 F2 T⇩1 T⇩2 U⇩1 U⇩2 D⇩1' D⇩2' R⇩1 R⇩2 mapper›
unfolding Transformation_BiFunctor_def
by (clarsimp simp add: subset_iff; blast)
lemma CV_TrFunctor_sub_dom:
‹ (⋀x. D⇩1 x ⊆ D⇩1' x)
⟹ (⋀x. D⇩2 x ⊆ D⇩2' x)
⟹ CV_TrFunctor F1 F2 T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 mapper
⟹ CV_TrFunctor F1 F2 T⇩1 T⇩2 U⇩1 U⇩2 D⇩1' D⇩2' R⇩1 R⇩2 mapper›
unfolding CV_TrFunctor_def
by (clarsimp simp add: subset_iff; smt)
lemma Transformation_BiFunctor_sub_rng:
‹ (⋀x. R⇩1' x ⊆ R⇩1 x)
⟹ (⋀x. R⇩2' x ⊆ R⇩2 x)
⟹ Transformation_BiFunctor F1 F2 T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 mapper
⟹ Transformation_BiFunctor F1 F2 T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1' R⇩2' mapper›
unfolding Transformation_BiFunctor_def
by (clarsimp simp add: subset_iff; blast)
lemma Transformation_BiFunctor_sub_mapper:
‹ ma ≤ mb
⟹ Transformation_BiFunctor F1 F2 T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 ma
⟹ Transformation_BiFunctor F1 F2 T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 mb›
unfolding Transformation_BiFunctor_def le_fun_def Transformation_def
by (clarsimp simp add: Ball_def; smt (verit, best))
lemma apply_Transformation_BiFunctor:
‹ Transformation_BiFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 mapper
⟹ (⋀a. 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 a ∈ D⇩1 x ⟹ a ⦂ T⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩1 𝗌𝗎𝖻𝗃 b. g⇩1 a b)
⟹ (⋀a. 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 a ∈ D⇩2 x ⟹ a ⦂ T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩2 𝗌𝗎𝖻𝗃 b. g⇩2 a b)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀a b. a ∈ D⇩1 x ∧ g⇩1 a b ⟶ b ∈ R⇩1 x) ∧ (∀a b. a ∈ D⇩2 x ∧ g⇩2 a b ⟶ b ∈ R⇩2 x)
⟹ x ⦂ Fa T⇩1 T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U⇩1 U⇩2 𝗌𝗎𝖻𝗃 y. mapper g⇩1 g⇩2 x y ›
unfolding Transformation_BiFunctor_def Premise_def
by simp
lemma apply_Functional_Transformation_BiFunctor:
‹ Functional_Transformation_BiFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 pred_mapper func_mapper
⟹ (⋀a ∈ D⇩1 x. 𝗎𝗌𝖾𝗋 a ⦂ T⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f⇩1 a ⦂ U⇩1 𝗐𝗂𝗍𝗁 P⇩1 a)
⟹ (⋀a ∈ D⇩2 x. 𝗎𝗌𝖾𝗋 a ⦂ T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f⇩2 a ⦂ U⇩2 𝗐𝗂𝗍𝗁 P⇩2 a)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀a. a ∈ D⇩1 x ⟶ f⇩1 a ∈ R⇩1 x) ∧ (∀a. a ∈ D⇩2 x ⟶ f⇩2 a ∈ R⇩2 x)
⟹ x ⦂ Fa T⇩1 T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 func_mapper f⇩1 f⇩2 P⇩1 P⇩2 x ⦂ Fb U⇩1 U⇩2 𝗐𝗂𝗍𝗁 pred_mapper f⇩1 f⇩2 P⇩1 P⇩2 x›
unfolding meta_Ball_def Argument_def Premise_def
Functional_Transformation_BiFunctor_def Transformation_Functor_def
by clarsimp
lemma apply_Functional_CV_BiFunctor:
‹ Fun_CV_TrFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 FC⇩1 R⇩2 pred_mapper func_mapper
⟹ (⋀a. 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 f⇩1 a ∈ D⇩1 x ⟹ 𝗎𝗌𝖾𝗋 a ⦂ U⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f⇩1 a ⦂ T⇩1 𝗐𝗂𝗍𝗁 P⇩1 a)
⟹ (⋀a ∈ D⇩2 x. 𝗎𝗌𝖾𝗋 a ⦂ T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f⇩2 a ⦂ U⇩2 𝗐𝗂𝗍𝗁 P⇩2 a)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 FC⇩1 f⇩1 x ∧ (∀a. a ∈ D⇩2 x ⟶ f⇩2 a ∈ R⇩2 x)
⟹ x ⦂ Fa T⇩1 T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 func_mapper f⇩1 f⇩2 P⇩1 P⇩2 x ⦂ Fb U⇩1 U⇩2 𝗐𝗂𝗍𝗁 pred_mapper f⇩1 f⇩2 P⇩1 P⇩2 x›
unfolding meta_Ball_def Argument_def Premise_def
Fun_CV_TrFunctor_def Transformation_Functor_def
by clarsimp
subsubsection ‹Transformation Functor with Parameterization›
lemma Transformation_Functor⇩Λ_sub_dom:
‹ (⋀p x. Da p x ⊆ Db p x)
⟹ Transformation_Functor⇩Λ F1 F2 T U Da R mapper
⟹ Transformation_Functor⇩Λ F1 F2 T U Db R mapper›
unfolding Transformation_Functor⇩Λ_def
by (clarsimp simp add: subset_iff; blast)
lemma Transformation_Functor⇩Λ_sub_rng:
‹ (⋀p x. Rb p x ⊆ Ra p x)
⟹ Transformation_Functor⇩Λ F1 F2 T U D Ra mapper
⟹ Transformation_Functor⇩Λ F1 F2 T U D Rb mapper›
unfolding Transformation_Functor⇩Λ_def
by (clarsimp simp add: subset_iff; blast)
lemma Transformation_Functor⇩Λ_sub_mapper:
‹ ma ≤ mb
⟹ Transformation_Functor⇩Λ F1 F2 T U D R ma
⟹ Transformation_Functor⇩Λ F1 F2 T U D R mb›
unfolding Transformation_Functor⇩Λ_def
by (clarsimp simp add: le_fun_def Transformation_def Ball_def, blast)
lemma apply_Transformation_Functor⇩Λ:
‹ Transformation_Functor⇩Λ Fa Fb T U D R mapper
⟹ (⋀p a. 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 a ∈ D p x ⟹ a ⦂ T p 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U p 𝗌𝗎𝖻𝗃 b. g p a b)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀p a b. a ∈ D p x ∧ g p a b ⟶ b ∈ R p x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U 𝗌𝗎𝖻𝗃 y. mapper g x y ›
unfolding Transformation_Functor⇩Λ_def Premise_def Transformation_def
by clarsimp
lemma apply_Functional_Transformation_Functor⇩Λ:
‹ Functional_Transformation_Functor⇩Λ Fa Fb T U D R pred_mapper func_mapper
⟹ (⋀p. ⋀a ∈ D p x. 𝗎𝗌𝖾𝗋 a ⦂ T p 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f p a ⦂ U p 𝗐𝗂𝗍𝗁 P p a)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀p a. a ∈ D p x ⟶ f p a ∈ R p x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 func_mapper f P x ⦂ Fb U 𝗐𝗂𝗍𝗁 pred_mapper f P x›
unfolding meta_Ball_def Argument_def Premise_def Functional_Transformation_Functor⇩Λ_def
by clarsimp
subsubsection ‹Separation Homo / Functor›
lemma apply_sep_homo:
‹ Object_Sep_Homo⇩I T D
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (x,y) ∈ D
⟹ (x ⦂ T) * (y ⦂ T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x * y ⦂ T 𝗐𝗂𝗍𝗁 x ## y›
unfolding Object_Sep_Homo⇩I_def Premise_def by simp
lemma apply_sep_homo_unzip:
‹ Object_Sep_Homo⇩E T
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x ## y
⟹ (x * y ⦂ T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 (x ⦂ T) * (y ⦂ T)›
unfolding Object_Sep_Homo⇩E_def Premise_def by blast
lemma Separation_Homo⇩I_sub_D:
‹ D' ⊆ D
⟹ Separation_Homo⇩I F⇩a F⇩b F⇩c T U D z
⟹ Separation_Homo⇩I F⇩a F⇩b F⇩c T U D' z›
unfolding Separation_Homo⇩I_def
by blast
lemma Separation_Homo⇩I⇩2_sub_D:
‹ D' ⊆ D
⟹ Separation_Homo⇩I⇩2 F⇩a F⇩b F⇩c T⇩1 T⇩2 U⇩1 U⇩2 D z
⟹ Separation_Homo⇩I⇩2 F⇩a F⇩b F⇩c T⇩1 T⇩2 U⇩1 U⇩2 D' z›
unfolding Separation_Homo⇩I⇩2_def
by blast
lemma Separation_Homo⇩I_Cond_sub_D:
‹ D' ⊆ D
⟹ Separation_Homo⇩I_Cond F⇩a F⇩b F⇩c C⇩W T U D z
⟹ Separation_Homo⇩I_Cond F⇩a F⇩b F⇩c C⇩W T U D' z›
unfolding Separation_Homo⇩I_Cond_def
by blast
lemma Separation_Homo⇩I_Cond⇩2_sub_D:
‹ D' ⊆ D
⟹ Separation_Homo⇩I⇩2_Cond F⇩a F⇩b F⇩c C⇩W T⇩1 T⇩2 U⇩1 U⇩2 D z
⟹ Separation_Homo⇩I⇩2_Cond F⇩a F⇩b F⇩c C⇩W T⇩1 T⇩2 U⇩1 U⇩2 D' z›
unfolding Separation_Homo⇩I⇩2_Cond_def
by blast
lemma Separation_Homo⇩E_Cond_sub_D:
‹ D' ⊆ D
⟹ Separation_Homo⇩E_Cond F⇩a F⇩b F⇩c C⇩R T U D z
⟹ Separation_Homo⇩E_Cond F⇩a F⇩b F⇩c C⇩R T U D' z›
unfolding Separation_Homo⇩E_Cond_def
by blast
lemma apply_Separation_Homo⇩I:
‹ Separation_Homo⇩I Ft Fu Fc T U D z
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x ∈ D
⟹ x ⦂ Ft(T) ∗ Fu(U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z x ⦂ Fc(T ∗ U)›
unfolding Separation_Homo⇩I_def Premise_def meta_Ball_def meta_case_prod_def split_paired_all
by (cases x; simp)
lemma apply_Separation_Homo⇩I⇩2 :
‹ Separation_Homo⇩I⇩2 Ft Fu Fc T⇩1 T⇩2 U⇩1 U⇩2 D z
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x ∈ D
⟹ x ⦂ Ft T⇩1 T⇩2 ∗ Fu U⇩1 U⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z x ⦂ Fc (T⇩1 ∗ U⇩1) (T⇩2 ∗ U⇩2) ›
unfolding Separation_Homo⇩I⇩2_def Premise_def meta_Ball_def meta_case_prod_def split_paired_all
by (cases x; simp)
lemma apply_Separation_Homo⇩E:
‹ Separation_Homo⇩E Ft Fu Fc T U Du un
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x ∈ Du
⟹ x ⦂ Fc(T ∗ U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 un x ⦂ Ft(T) ∗ Fu(U)›
unfolding Separation_Homo⇩E_def φProd_expn'[symmetric] Premise_def
by simp
lemma apply_Separation_Homo⇩E⇩2:
‹ Separation_Homo⇩E⇩2 Ft Fu Fc T⇩1 T⇩2 U⇩1 U⇩2 Du un
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x ∈ Du
⟹ x ⦂ Fc (T⇩1 ∗ U⇩1) (T⇩2 ∗ U⇩2) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 un x ⦂ Ft T⇩1 T⇩2 ∗ Fu U⇩1 U⇩2›
unfolding Separation_Homo⇩E⇩2_def φProd_expn'[symmetric] Premise_def
by simp
lemma apply_Separation_Homo⇩I_Cond:
‹ Separation_Homo⇩I_Cond Ft Fu Fc C T U D z
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x ∈ D
⟹ x ⦂ Ft T ∗ ◒[C] Fu U 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z x ⦂ Fc (T ∗ ◒[C] U)›
unfolding Separation_Homo⇩I_Cond_def Premise_def split_paired_all
by (cases x; simp)
lemma apply_Separation_Homo⇩I⇩2_Cond:
‹ Separation_Homo⇩I⇩2_Cond Ft Fu Fc C⇩R T⇩1 T⇩2 U⇩1 U⇩2 D z
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x ∈ D
⟹ x ⦂ Ft T⇩1 T⇩2 ∗ ◒[C⇩R] Fu U⇩1 U⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z x ⦂ Fc (T⇩1 ∗ ◒[C⇩R] U⇩1) (T⇩2 ∗ ◒[C⇩R] U⇩2) ›
unfolding Separation_Homo⇩I⇩2_Cond_def Premise_def split_paired_all
by (cases x; simp)
lemma apply_Separation_Homo⇩E_Cond:
‹ Separation_Homo⇩E_Cond Ft Fu Fc C T U D un
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x ∈ D
⟹ x ⦂ Fc (T ∗ ◒[C] U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 un x ⦂ Ft T ∗ ◒[C] Fu U›
unfolding Separation_Homo⇩E_Cond_def φProd_expn'[symmetric] Premise_def
by simp
lemma apply_Separation_Homo⇩E⇩2_Cond:
‹ Separation_Homo⇩E⇩2_Cond Ft Fu Fc C T⇩1 T⇩2 U⇩1 U⇩2 D un
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x ∈ D
⟹ x ⦂ Fc (T⇩1 ∗ ◒[C] U⇩1) (T⇩2 ∗ ◒[C] U⇩2) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 un x ⦂ Ft T⇩1 T⇩2 ∗ ◒[C] Fu U⇩1 U⇩2›
unfolding Separation_Homo⇩E⇩2_Cond_def φProd_expn'[symmetric] Premise_def
by simp
paragraph ‹With Parameterization›
lemma Separation_Homo⇩Λ⇩I_sub_D:
‹ D' ⊆ D
⟹ Separation_Homo⇩Λ⇩I F⇩a F⇩b F⇩c T U D z
⟹ Separation_Homo⇩Λ⇩I F⇩a F⇩b F⇩c T U D' z›
unfolding Separation_Homo⇩Λ⇩I_def
by blast
lemma Separation_Homo⇩Λ⇩I_Cond_sub_D:
‹ D' ⊆ D
⟹ Separation_Homo⇩Λ⇩I_Cond F⇩a F⇩b F⇩c C⇩W T U D z
⟹ Separation_Homo⇩Λ⇩I_Cond F⇩a F⇩b F⇩c C⇩W T U D' z›
unfolding Separation_Homo⇩Λ⇩I_Cond_def
by blast
lemma Separation_Homo⇩Λ⇩E_Cond_sub_D:
‹ D' ⊆ D
⟹ Separation_Homo⇩Λ⇩E_Cond F⇩a F⇩b F⇩c C⇩R T U D z
⟹ Separation_Homo⇩Λ⇩E_Cond F⇩a F⇩b F⇩c C⇩R T U D' z›
unfolding Separation_Homo⇩Λ⇩E_Cond_def
by blast
lemma apply_Separation_Homo⇩Λ⇩I:
‹ Separation_Homo⇩Λ⇩I Ft Fu Fc T U D z
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x ∈ D
⟹ x ⦂ Ft(T) ∗ Fu(U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z x ⦂ Fc(λp. T p ∗ U p)›
unfolding Separation_Homo⇩Λ⇩I_def Premise_def meta_Ball_def meta_case_prod_def split_paired_all
by (cases x; simp)
lemma apply_Separation_Homo⇩Λ⇩E:
‹ Separation_Homo⇩Λ⇩E Ft Fu Fc T U Du un
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x ∈ Du
⟹ x ⦂ Fc(λp. T p ∗ U p) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 un x ⦂ Ft(T) ∗ Fu(U)›
unfolding Separation_Homo⇩Λ⇩E_def φProd_expn'[symmetric] Premise_def
by simp
lemma apply_Separation_Homo⇩Λ⇩I_Cond:
‹ Separation_Homo⇩Λ⇩I_Cond Ft Fu Fc C⇩R T U D z
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x ∈ D
⟹ x ⦂ Ft(T) ∗ ◒[C⇩R] Fu(U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z x ⦂ Fc(λp. T p ∗ ◒[C⇩R] U p)›
unfolding Separation_Homo⇩Λ⇩I_Cond_def Premise_def split_paired_all
by (cases x; simp)
lemma apply_Separation_Homo⇩Λ⇩E_Cond:
‹ Separation_Homo⇩Λ⇩E_Cond Ft Fu Fc C⇩W T U D un
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x ∈ D
⟹ x ⦂ Fc(λp. T p ∗ ◒[C⇩W] U p) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 un x ⦂ Ft(T) ∗ ◒[C⇩W] Fu(U)›
unfolding Separation_Homo⇩Λ⇩E_Cond_def φProd_expn'[symmetric] Premise_def
by simp
subsubsection ‹Semimodule›
paragraph ‹Association›
lemma apply_Semimodule_SAssoc⇩I:
‹ Module_Assoc⇩I Fs Ft Fc T Ds Dt Dx smul f
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 Ds s ∧ Dt t ∧ Dx s t x
⟹ x ⦂ Fs s (Ft t T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f s t x ⦂ Fc (smul s t) T ›
unfolding Module_Assoc⇩I_def Premise_def
by clarsimp
lemma apply_Semimodule_SAssoc⇩E:
‹ Module_Assoc⇩E Fs Ft Fc T Ds Dt Dx smul f
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 Ds s ∧ Dt t ∧ Dx s t x
⟹ x ⦂ Fc (smul s t) T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f s t x ⦂ Fs s (Ft t T) ›
unfolding Module_Assoc⇩E_def Premise_def
by clarsimp
paragraph ‹Identity Element›
lemma apply_Module_One⇩I:
‹ Module_One⇩I F T⇩1 one D f P
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ T⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f x ⦂ F one 𝗐𝗂𝗍𝗁 P x ›
unfolding Module_One⇩I_def Premise_def
by simp
lemma apply_Module_One⇩E:
‹ Module_One⇩E F T⇩1 one D f P
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ F one 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f x ⦂ T⇩1 𝗐𝗂𝗍𝗁 P x ›
unfolding Module_One⇩E_def Premise_def
by simp
paragraph ‹Left Distributivity›
lemma Module_Distr_Homo⇩Z_sub:
‹ Ds ≤ Ds' ∧ Dx ≤ Dx'
⟹ Module_Distr_Homo⇩Z F Ds' Dx' z
⟹ Module_Distr_Homo⇩Z F Ds Dx z›
unfolding Module_Distr_Homo⇩Z_def le_fun_def le_bool_def
by blast
lemma [φadding_property = false,
φreason %φTA_varify_out except ‹Module_Distr_Homo⇩Z _ ?var_Ds ?var_Dx _›,
φadding_property = true ]:
‹ Module_Distr_Homo⇩Z F Ds' Dx' z
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 Ds ≤ Ds' ∧ Dx ≤ Dx'
⟹ Module_Distr_Homo⇩Z F Ds Dx z›
unfolding Premise_def
using Module_Distr_Homo⇩Z_sub by blast
lemma apply_Module_Distr_Homo⇩Z:
‹ Module_Distr_Homo⇩Z F Ds Dx z
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 Ds s ∧ Ds t ∧ s ##⇩+ t ∧ Dx s t x
⟹ x ⦂ F s ∗ F t 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z s t x ⦂ F (s + t) ›
unfolding Module_Distr_Homo⇩Z_def Premise_def
by blast
lemma apply_Module_Distr_Homo⇩Z_RCond_φSome:
‹ Module_Distr_Homo⇩Z F Ds Dx z
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (C ⟶ Ds s ∧ Ds t ∧ s ##⇩+ t ∧ Dx s t x) ∧ ?⇩+ True r = ?⇩+ True s + ?⇩+ C t
⟹ x ⦂ F s ∗ ◒[C] F t 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 ?⇩j⇩R C (z s t) x ⦂ F r ›
unfolding Module_Distr_Homo⇩Z_def Premise_def Transformation_def
by (cases C; clarsimp; metis prod.collapse)
lemma apply_Module_Distr_Homo⇩Z_LCond_φSome:
‹ Module_Distr_Homo⇩Z F Ds Dx z
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (C ⟶ Ds s ∧ Ds t ∧ s ##⇩+ t ∧ Dx s t x) ∧ ?⇩+ True r = ?⇩+ C s + ?⇩+ True t
⟹ x ⦂ ◒[C] F s ∗ F t 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 ?⇩j⇩L C (z s t) x ⦂ F r ›
unfolding Module_Distr_Homo⇩Z_def Premise_def Transformation_def
by (cases C; clarsimp; metis prod.collapse)
lemma apply_Module_Distr_Homo⇩Z_rev:
‹ Module_Distr_Homo⇩Z F Ds Dx' z'
⟹ Module_Distr_Homo⇩Z_rev F Ds Dx' z' Dx z
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 Ds s ∧ Ds t ∧ t ##⇩+ s ∧ Dx s t x
⟹ x ⦂ F s ∗ F t 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z s t x ⦂ F (t + s) ›
unfolding Module_Distr_Homo⇩Z_rev_def Premise_def
by blast
lemma apply_Module_Distr_Homo⇩S:
‹ Module_Distr_Homo⇩S F Ds Dx uz
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 Ds s ∧ Ds t ∧ s ##⇩+ t ∧ Dx s t x
⟹ x ⦂ F (s + t) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 uz s t x ⦂ F s ∗ F t ›
unfolding Module_Distr_Homo⇩S_def Premise_def
by blast
lemma apply_Module_Distr_Homo⇩S_RCond:
‹ Module_Distr_Homo⇩S F Ds Dx uz
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (C ⟶ Ds s ∧ Ds t ∧ s ##⇩+ t ∧ Dx s t x) ∧
?⇩+ True r = ?⇩+ True s + ?⇩+ C t
⟹ x ⦂ F r 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 ?⇩s⇩R C (uz s t) x ⦂ F s ∗ ◒[C] F t ›
unfolding Premise_def Module_Distr_Homo⇩S_def Transformation_def
by (cases C; clarsimp; metis sep_disj_option(1) times_option(1))
lemma apply_Module_Distr_Homo⇩S_LCond:
‹ Module_Distr_Homo⇩S F Ds Dx uz
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (C ⟶ Ds s ∧ Ds t ∧ s ##⇩+ t ∧ Dx s t x) ∧
?⇩+ True r = ?⇩+ C s + ?⇩+ True t
⟹ x ⦂ F r 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 ?⇩s⇩L C (uz s t) x ⦂ ◒[C] F s ∗ F t ›
unfolding Premise_def Module_Distr_Homo⇩S_def Transformation_def
by (cases C; clarsimp; metis sep_disj_option(1) times_option(1))
lemma apply_Module_Distr_Homo⇩S_rev:
‹ Module_Distr_Homo⇩S F Ds Dx' uz'
⟹ Module_Distr_Homo⇩S_rev F Dx' uz' Ds Dx uz
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 Ds s ∧ Ds t ∧ t ##⇩+ s ∧ Dx s t x
⟹ x ⦂ F (t + s) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 uz s t x ⦂ F s ∗ F t ›
unfolding Module_Distr_Homo⇩S_rev_def Premise_def
by blast
subsubsection ‹Swap \& Assoc Normalization›
φreasoner_group φToA_SA_norm = (1000, [10,2000]) in φsimp_all
‹normalize the φ-type by swapping, as that specified by ‹φToA_swap_normalization››
and φToA_SA_derived = (50, [50, 50]) in φsimp_derived and in φToA_SA_norm
and > φsimp_derived_Tr_functor
‹derived›
ML_file ‹library/phi_type_algebra/commutativity.ML›
definition Require_Swap_Norm :: ‹('c,'a) φ ⇒ bool›
where ‹Require_Swap_Norm F_G_T ≡ True›
definition Not_Require_Swap_Norm :: ‹('c,'a) φ ⇒ bool›
where ‹Not_Require_Swap_Norm F_G_T ≡ True›
definition Require_Assoc_Norm :: ‹('c,'a) φ ⇒ bool ⇒ bool›
where ‹Require_Assoc_Norm F_G_T direction ≡ True›
definition Not_Require_Assoc_Norm :: ‹('c,'a) φ ⇒ bool ⇒ bool›
where ‹Not_Require_Assoc_Norm F_G_T direction ≡ True›
definition Require_SA_Norm :: ‹('c,'a) φ ⇒ bool ⇒ bool›
where ‹Require_SA_Norm F_G_T direction ≡ Require_Swap_Norm F_G_T ∨ Require_Assoc_Norm F_G_T direction ›
definition Not_Require_SA_Norm :: ‹('c,'a) φ ⇒ bool ⇒ bool›
where ‹Not_Require_SA_Norm F_G_T direction ≡ Not_Require_Swap_Norm F_G_T ∧ Not_Require_Assoc_Norm F_G_T direction ›
φreasoner_ML Require_Swap_Norm %cutting (‹Require_Swap_Norm _›) = ‹ fn (_, (ctxt,sequent)) => Seq.make (fn () =>
let val (bvs, F_G_T) =
case Phi_Help.strip_meta_hhf_bvs (Phi_Help.leading_antecedent' sequent)
of (bvtys, _ $ (Const _ $ F_G_T)) =>
(bvtys, F_G_T)
in if Phi_Type.whether_to_swap_normalize (Context.Proof ctxt) bvs F_G_T
then SOME ((ctxt, @{lemma' ‹Require_Swap_Norm F› by (simp add: Require_Swap_Norm_def)} RS sequent), Seq.empty)
else NONE
end)
›
φreasoner_ML Not_Require_Swap_Norm %cutting (‹Not_Require_Swap_Norm _›) = ‹ fn (_, (ctxt,sequent)) => Seq.make (fn () =>
let val (bvs, F_G_T) =
case Phi_Help.strip_meta_hhf_bvs (Phi_Help.leading_antecedent' sequent)
of (bvtys, _ $ (Const _ $ F_G_T)) =>
(bvtys, F_G_T)
in if Phi_Type.whether_to_swap_normalize (Context.Proof ctxt) bvs F_G_T
then NONE
else SOME ((ctxt, @{lemma' ‹Not_Require_Swap_Norm F› by (simp add: Not_Require_Swap_Norm_def)} RS sequent), Seq.empty)
end)
›
φreasoner_ML Require_Assoc_Norm %cutting (‹Require_Assoc_Norm _ _›) = ‹ fn (_, (ctxt,sequent)) => Seq.make (fn () =>
let val (bvs, F_G_T, direction) =
case Phi_Help.strip_meta_hhf_bvs (Phi_Help.leading_antecedent' sequent)
of (bvtys, _ $ (Const _ $ F_G_T $ direction)) =>
(bvtys, F_G_T, (case direction of \<^Const>‹True› => Phi_Type.AD_INTRO
| \<^Const>‹False› => Phi_Type.AD_ELIM
| _ => raise TERM ("Bad direction of Require_Assoc_Norm", [direction])))
in if Phi_Type.whether_to_assoc_normalize (Context.Proof ctxt) direction bvs F_G_T
then SOME ((ctxt, @{lemma' ‹Require_Assoc_Norm F Any› by (simp add: Require_Assoc_Norm_def)} RS sequent), Seq.empty)
else NONE
end)
›
φreasoner_ML Not_Require_Assoc_Norm %cutting (‹Not_Require_Assoc_Norm _ _›) = ‹ fn (_, (ctxt,sequent)) => Seq.make (fn () =>
let val (bvs, F_G_T, direction) =
case Phi_Help.strip_meta_hhf_bvs (Phi_Help.leading_antecedent' sequent)
of (bvtys, _ $ (Const _ $ F_G_T $ direction)) =>
(bvtys, F_G_T, (case direction of \<^Const>‹True› => Phi_Type.AD_INTRO
| \<^Const>‹False› => Phi_Type.AD_ELIM
| _ => raise TERM ("Bad direction of Require_Assoc_Norm", [direction])))
in if Phi_Type.whether_to_assoc_normalize (Context.Proof ctxt) direction bvs F_G_T
then NONE
else SOME ((ctxt, @{lemma' ‹Not_Require_Assoc_Norm F Any› by (simp add: Not_Require_Assoc_Norm_def)} RS sequent), Seq.empty)
end)
›
φreasoner_ML Require_SA_Norm %cutting (‹Require_SA_Norm _ _›) = ‹ fn (_, (ctxt,sequent)) => Seq.make (fn () =>
let val (bvs, F_G_T, direction) =
case Phi_Help.strip_meta_hhf_bvs (Phi_Help.leading_antecedent' sequent)
of (bvtys, _ $ (Const _ $ F_G_T $ direction)) =>
(bvtys, F_G_T, (case direction of \<^Const>‹True› => Phi_Type.AD_INTRO
| \<^Const>‹False› => Phi_Type.AD_ELIM
| _ => raise TERM ("Bad direction of Require_SA_Norm", [direction])))
in if Phi_Type.whether_to_SA_normalize (Context.Proof ctxt) direction bvs F_G_T
then SOME ((ctxt, @{lemma' ‹Require_SA_Norm F Any›
by (simp add: Require_SA_Norm_def Require_Assoc_Norm_def )} RS sequent), Seq.empty)
else NONE
end)
›
φreasoner_ML Not_Require_SA_Norm %cutting (‹Not_Require_SA_Norm _ _›) = ‹ fn (_, (ctxt,sequent)) => Seq.make (fn () =>
let val (bvs, F_G_T, direction) =
case Phi_Help.strip_meta_hhf_bvs (Phi_Help.leading_antecedent' sequent)
of (bvtys, _ $ (Const _ $ F_G_T $ direction)) =>
(bvtys, F_G_T, (case direction of \<^Const>‹True› => Phi_Type.AD_INTRO
| \<^Const>‹False› => Phi_Type.AD_ELIM
| _ => raise TERM ("Bad direction of Not_Require_SA_Norm", [direction])))
in if Phi_Type.whether_to_SA_normalize (Context.Proof ctxt) direction bvs F_G_T
then NONE
else SOME ((ctxt, @{lemma' ‹Not_Require_SA_Norm F Any›
by (simp add: Not_Require_SA_Norm_def Not_Require_Assoc_Norm_def Not_Require_Swap_Norm_def )}
RS sequent), Seq.empty)
end)
›
subsection ‹Programming Methods to Prove the Properties›
subsubsection ‹Transformation Functor›
lemma [φreason %φprogramming_method]:
‹ PROP φProgramming_Method (⋀x g.
∀a ∈ D x. a ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U 𝗌𝗎𝖻𝗃 b. g a b
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀a b. a ∈ D x ∧ g a b ⟶ b ∈ R x)
⟹ x ⦂ F1 T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F2 U 𝗌𝗎𝖻𝗃 y. mapper g x y) MM DD RR FF
⟹ PROP φProgramming_Method (Trueprop (Transformation_Functor F1 F2 T U D R mapper)) MM DD RR FF›
unfolding φProgramming_Method_def Transformation_Functor_def Premise_def
by clarsimp
lemma [φreason %φprogramming_method]:
‹ PROP φProgramming_Method (⋀x g⇩1 g⇩2.
∀a ∈ D⇩1 x. a ⦂ T⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩1 𝗌𝗎𝖻𝗃 b. g⇩1 a b
⟹ ∀a ∈ D⇩2 x. a ⦂ T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩2 𝗌𝗎𝖻𝗃 b. g⇩2 a b
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀a b. a ∈ D⇩1 x ∧ g⇩1 a b ⟶ b ∈ R⇩1 x) ∧ (∀a b. a ∈ D⇩2 x ∧ g⇩2 a b ⟶ b ∈ R⇩2 x)
⟹ x ⦂ F1 T⇩1 T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F2 U⇩1 U⇩2 𝗌𝗎𝖻𝗃 y. mapper g⇩1 g⇩2 x y) MM DD RR FF
⟹ PROP φProgramming_Method (Trueprop (Transformation_BiFunctor F1 F2 T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 mapper)) MM DD RR FF›
unfolding φProgramming_Method_def Transformation_BiFunctor_def Premise_def
Transformation_def
by (simp add: atomize_imp atomize_all)
subsubsection ‹Separation Homo›
subsubsection ‹Semimodule Functor›
lemma [φreason %φprogramming_method]:
‹ PROP φProgramming_Method (⋀s t x y.
𝗉𝗋𝖾𝗆𝗂𝗌𝖾 Ds s ∧ Ds t ∧ s ##⇩+ t ∧ Dx s t (x,y)
⟹ (x ⦂ F s) * (y ⦂ F t) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z s t (x,y) ⦂ F (s + t)
) MM DD RR FF
⟹ PROP φProgramming_Method (Trueprop (Module_Distr_Homo⇩Z F Ds Dx z)) MM DD RR FF›
unfolding φProgramming_Method_def Module_Distr_Homo⇩Z_def Premise_def norm_hhf_eq
by (clarsimp simp add: φProd_expn')
lemma [φreason %φprogramming_method]:
‹ PROP φProgramming_Method (⋀s t x.
𝗉𝗋𝖾𝗆𝗂𝗌𝖾 Ds s ∧ Ds t ∧ s ##⇩+ t ∧ Dx s t x
⟹ x ⦂ F (s + t) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 uz s t x ⦂ F s ∗ F t
) MM DD RR FF
⟹ PROP φProgramming_Method (Trueprop (Module_Distr_Homo⇩S F Ds Dx uz)) MM DD RR FF›
unfolding φProgramming_Method_def Module_Distr_Homo⇩S_def Premise_def norm_hhf_eq
by (clarsimp simp add: φProd_expn')
section ‹Definition and Deriving Tools for φ-Types›
text ‹The @{command φtype_def} command always generate 4 sorts of rules.
For instance, for definition ‹x ⦂ T ≡ U›,
▪ ▩‹T.intro› of form \<^prop>‹U 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ T›. There are corresponding reasoning rules named ▩‹T.intro_reasoning›.
By default the reasoning rules are not activated. You may activate them by
▩‹declare T.intro_reasoning[φreason]› in order to, for instance, reduce to ‹U› the reasoning of
∗‹every› transformation goal targeting to ‹T›. Depending on the priority you configured,
if the priority is greater than 54 (the priority of the entry point of the Structural Extraction),,
this reduction happens before any in-depth reasoning that collects proportions in the source
objects to synthesis the target ‹T› (i.e. the Structural Extraction, SE);
if the priority is less than 50, it serves as a fallback when the SE fails.
In any case even if you do not activate the intro rule, the system always activates a rule
that allows you to use \<^term>‹MAKE T› tag to invoke the intro rule and to make a φ-type term
of ‹T› from ‹U›. To use it, just write φ-Lang ▩‹‹x ⦂ MAKE T›› to invoke the synthesis process.
▪ ▩‹T.elim› of form \<^prop>‹x ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 U›. There are also corresponding reasoning rules named ▩‹T.elim_reasoning›.
They are also not activated by default. The priority of them can be more arbitrary because they are
in the SE process as the last stage of the ∃free-ToA reasoning. Note the ∃free-ToA reasoning
works not good if the elim rule introduces existential quantification, because the ∃free-ToA
by design does not consider opening abstraction.
No matter if the reasoning rules are activated, you can always open an abstraction using
To-Transformation, i.e., φ-Lang ▩‹to ‹List OPEN›› for instance to open ‹x" ⦂ List T› into
‹{ y" ⦂ List U' | List.rel P x" y" }› if ‹U ≡ { y ⦂ U' | P y }› for some ‹y› and ‹y"› that
maybe in a set if ‹x ⦂ T› is an abstraction of a set of ‹ { y ⦂ U' | P y } ›.
▪ ▩‹T.unfold›, \<^prop>‹(x ⦂ T) = U›
▪ ▩‹T.expansion›, \<^prop>‹p ⊨ (x ⦂ T) ⟷ p ⊨ U›. This rule is added to the system global simplifier.
If a definition like those recursive definitions is characterized by multiple equations.
The above rules are generated for each equation correspondingly.
›
subsection ‹Implementation›
paragraph ‹Templates Generating Rules›
subparagraph ‹Intro and Elim reasoning rules›
lemma φintro_transformation:
‹ (x ⦂ T) = U
⟹ U 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ T ›
by simp
lemma φintro_reasoning_transformation:
‹ (x ⦂ T) = U
⟹ A 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 U 𝗐𝗂𝗍𝗁 P
⟹ A 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ T 𝗐𝗂𝗍𝗁 P ›
by simp
text ‹The generated intro-rule is in ‹x ⦂ T ∗[C] R› form to the best which is the most general
and falls back to ‹x ⦂ T 𝗋𝖾𝗆𝖺𝗂𝗇𝗌[C] R› if the definition cannot be rewrote to type form ‹x ⦂ T ≡ y ⦂ U›.
Priorities: ‹φintro'_reasoning_transformation_ty_var› >
‹φintro'_reasoning_transformation_ty› >
‹φintro'_reasoning_transformation›
›
lemma φintro'_reasoning_transformation:
‹ (x ⦂ T) = U
⟹ A 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 U 𝗋𝖾𝗆𝖺𝗂𝗇𝗌 R 𝗐𝗂𝗍𝗁 P
⟹ A 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ T 𝗋𝖾𝗆𝖺𝗂𝗇𝗌 R 𝗐𝗂𝗍𝗁 P ›
by simp
lemma φintro'_reasoning_transformation_ty:
‹ (x ⦂ T) = (y ⦂ U)
⟹ A 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 yr ⦂ U ✼ R 𝗐𝗂𝗍𝗁 P
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 fst yr = y
⟹ A 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 (x, snd yr) ⦂ T ✼ R 𝗐𝗂𝗍𝗁 P ›
unfolding Premise_def φProd'_def
by (cases yr; simp add: φProd_expn')
lemma φelim_transformation:
‹ (x ⦂ T) = U
⟹ x ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 U ›
by simp
lemma φelim_reasoning_transformation:
‹ (x ⦂ T) = U
⟹ U 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P
⟹ x ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P ›
by simp
lemma φelim'SEi_transformation:
‹ (⋀x. (x ⦂ T) = (y x ⦂ U x))
⟹ (y (fst x), snd x) ⦂ U (fst x) ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P
⟹ x ⦂ T ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P ›
by (cases x; simp add: φProd_expn' φProd'_def)
lemma φintro_ToA_Mapper_template:
‹ (⋀x. (x ⦂ T ) = (ψ x ⦂ S ))
⟹ (⋀x. (x ⦂ T') = (ψ' x ⦂ S'))
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (∀x∈(f o ψ) `D. ψ' (φ' x) = x)
⟹ 𝗆𝖺𝗉 g : U ↦ U' 𝗈𝗏𝖾𝗋 f : S ↦ S' 𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s 𝗂𝗇 ψ ` D
⟹ 𝗆𝖺𝗉 g : U ↦ U' 𝗈𝗏𝖾𝗋 φ' o f o ψ : T ↦ T' 𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h o ψ 𝗌𝖾𝗍𝗍𝖾𝗋 φ' o s 𝗂𝗇 D ›
unfolding ToA_Mapper_def Premise_def
by clarsimp
lemma φintro_ToA_Mapper_template_SE:
‹ (⋀x. (x ⦂ T ) = (ψ x ⦂ S ))
⟹ (⋀x. (x ⦂ T') = (ψ' x ⦂ S'))
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (∀x∈(f o ψ o fst) `D. ψ' (φ' x) = x)
⟹ 𝗆𝖺𝗉 g : U ↦ U' 𝗈𝗏𝖾𝗋 f ⊗⇩f w : S ✼ W ↦ S' ✼ W' 𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s 𝗂𝗇 apfst ψ ` D
⟹ 𝗆𝖺𝗉 g : U ↦ U' 𝗈𝗏𝖾𝗋 (φ' o f o ψ) ⊗⇩f w : T ✼ W ↦ T' ✼ W' 𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h o apfst ψ 𝗌𝖾𝗍𝗍𝖾𝗋 apfst φ' o s 𝗂𝗇 D ›
unfolding ToA_Mapper_rev_def Premise_def φProd'_def
apply (clarsimp simp: φProd_expn' φProd_expn'' ball_conj_distrib[symmetric])
subgoal premises prems for a b
by (insert prems(1,2,5) prems(3,4)[THEN bspec[where x=‹(a,b)›], OF ‹(a, b) ∈ D›],
auto simp: φProd_expn' φProd_expn'') .
lemma φelim_ToA_Mapper_template:
‹ (⋀x. (x ⦂ U ) = (ψ x ⦂ S ))
⟹ (⋀x. (x ⦂ U') = (ψ' x ⦂ S'))
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (∀x∈h `D. ψ (φ x) = x)
⟹ 𝗆𝖺𝗉 ψ' o g o φ : S ↦ S' 𝗈𝗏𝖾𝗋 f : T ↦ T' 𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s 𝗂𝗇 D
⟹ 𝗆𝖺𝗉 g : U ↦ U' 𝗈𝗏𝖾𝗋 f : T ↦ T' 𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 φ o h 𝗌𝖾𝗍𝗍𝖾𝗋 s o ψ' 𝗂𝗇 D ›
unfolding ToA_Mapper_def Premise_def
by clarsimp
lemma φelim_ToA_Mapper_template_SE:
‹ (⋀x. (x ⦂ U ) = (ψ x ⦂ S ))
⟹ (⋀x. (x ⦂ U') = (ψ' x ⦂ S'))
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (∀x∈fst ` h `D. ψ (φ x) = x)
⟹ 𝗆𝖺𝗉 (ψ' o g o φ) ⊗⇩f r : S ✼ R ↦ S' ✼ R' 𝗈𝗏𝖾𝗋 f : T ↦ T' 𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s 𝗂𝗇 D
⟹ 𝗆𝖺𝗉 g ⊗⇩f r : U ✼ R ↦ U' ✼ R' 𝗈𝗏𝖾𝗋 f : T ↦ T' 𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 apfst φ o h 𝗌𝖾𝗍𝗍𝖾𝗋 s o apfst ψ' 𝗂𝗇 D ›
unfolding ToA_Mapper_rev_def Premise_def φProd'_def
apply (clarsimp simp: φProd_expn' φProd_expn'' ball_conj_distrib[symmetric])
subgoal premises prems for x
by (insert prems(1,2,5) prems(3,4)[THEN bspec[where x=‹x›], OF ‹x ∈ D›],
auto simp: φProd_expn' φProd_expn'' prod.map_beta) .
subparagraph ‹OPEN and MAKE›
text ‹No ‹Object_Equiv› is used and we use ‹(=)› directly because we are destructing or constructing
a φ-type abstraction by its definition where the definition covers every cases covered by the
‹Object_Equiv›, so there is no need to apply ‹Object_Equiv› any more.›
lemma φopen_abstraction_infer:
‹ (x ⦂ T) = R
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 x' = x
⟹ x' ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 R @tag OPEN var 𝒯𝒫 ›
unfolding Action_Tag_def Simplify_def 𝗋Guard_def Premise_def
by simp
lemma φopen_abstraction_specified:
‹ (x ⦂ T) = R
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x' = x
⟹ x' ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 R @tag OPEN i 𝒯𝒫 ›
unfolding Action_Tag_def Simplify_def 𝗋Guard_def Premise_def
by simp
lemma φopen_abstraction_ty:
‹ (x ⦂ T) = (y ⦂ U)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x' = x
⟹ x' ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ U @tag OPEN i 𝒯𝒫' ›
unfolding Action_Tag_def Simplify_def 𝗋Guard_def Premise_def
by simp
lemma φmake_abstraction_infer:
‹ (x ⦂ T) = U
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 x = x'
⟹ U 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x' ⦂ T @tag MAKE var 𝒯𝒫 ›
unfolding Object_Equiv_def Premise_def Transformation_def 𝗋Guard_def Ant_Seq_def
Orelse_shortcut_def Action_Tag_def
by clarsimp
lemma φmake_abstraction_specified:
‹ (x ⦂ T) = U
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x = x'
⟹ U 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x' ⦂ T @tag MAKE i 𝒯𝒫 ›
unfolding Object_Equiv_def Premise_def Transformation_def 𝗋Guard_def Ant_Seq_def
Orelse_shortcut_def Action_Tag_def
by clarsimp
lemma φmake_abstraction_ty:
‹ (x ⦂ T) = (y ⦂ U)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 y' = y
⟹ y' ⦂ U 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ T @tag MAKE i 𝒯𝒫' ›
unfolding Action_Tag_def Premise_def
by simp
lemma φgen_expansion:
‹ (x ⦂ T) = U
⟹ p ⊨ (x ⦂ T) ≡ p ⊨ U ›
by simp
lemma φunfold_val:
‹ (x ⦂ T) = (y ⦂ U)
⟹ (x ⦂ 𝗏𝖺𝗅[v] T) = (y ⦂ 𝗏𝖺𝗅[v] U) ›
unfolding Val_def BI_eq_iff φType_def
by auto
φreasoner_group all_derived_rules = (100, [0,999999]) ‹A group collecting all derived rules›
ML_file ‹library/phi_type_algebra/typ_def.ML›
consts under_φderiving :: mode
φreasoner_ML under_φderiving %cutting (‹True @tag under_φderiving›) = ‹
fn (_, (ctxt,sequent)) => Seq.make (fn () =>
if Config.get ctxt Phi_Type.under_deriving_ctxt
then SOME ((ctxt, @{lemma' ‹True @tag under_φderiving›
by (simp add: Action_Tag_def)} RS sequent), Seq.empty)
else NONE)
›
φreasoner_ML ‹Premise under_φderiving› %cutting (‹𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇[under_φderiving] _›) = ‹
fn (_, (ctxt, sequent)) => Seq.make (fn () =>
if Config.get ctxt Phi_Type.under_deriving_ctxt
then SOME ((ctxt, @{lemma' ‹𝗉𝗋𝖾𝗆𝗂𝗌𝖾 P ⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇[under_φderiving] P›
by (simp add: Premise_def)} RS sequent), Seq.empty)
else SOME ((ctxt, @{lemma' ‹𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 P ⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇[under_φderiving] P›
by (simp add: Premise_def)} RS sequent), Seq.empty))
›
lemma [φreason %extract_pure]:
‹ 𝗋EIF (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇[under_φderiving] P) P ›
unfolding 𝗋EIF_def Premise_def
by blast
lemma [φreason %extract_pure]:
‹ 𝗋ESC P (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇[under_φderiving] P) ›
unfolding 𝗋ESC_def Premise_def
by blast
hide_fact φintro_transformation φintro_reasoning_transformation φintro'_reasoning_transformation
φintro'_reasoning_transformation_ty φelim_transformation φelim_reasoning_transformation
φelim'SEi_transformation φintro_ToA_Mapper_template
subsection ‹Instances for Predefined Basic φ-Types›
text ‹The section manually gives property instances of predefined basic φ-types and any later φ-types
are defined using φ-type definition tools and their property instances are derived by derivers.
Though the property instances of the basic φ-types are given manually here, it does not mean they
are primitive and cannot be derived automatically. It is just engineeringly, the types are bootstraps
given very early in the initiation process of the system, so have no chance to enjoy the automation of
deriver tools and because some properties of them are given manually early, the remaining properties
also cannot be configured using the deriver tool otherwise clashes happen.
›
section ‹Applications of the Algebraic Properties in Reasoning›
subsection ‹Vary Type Operator among Instantiations›
definition Type_Variant_of_the_Same_Type_Operator
:: ‹ ('a ⇒ ('b,'c) φ) ⇒ ('a2 ⇒ ('b2,'c2) φ) ⇒ bool ›
where ‹ Type_Variant_of_the_Same_Type_Operator Fa Fb ⟷ True ›
definition Type_Variant_of_the_Same_Type_Operator2
:: ‹ ('s ⇒ 'a ⇒ ('b,'c) φ) ⇒ ('s2 ⇒ 'a2 ⇒ ('b2,'c2) φ) ⇒ bool ›
where ‹ Type_Variant_of_the_Same_Type_Operator2 Fa Fb ⟷ True ›
definition Type_Variant_of_the_Same_Scalar_Mul⇩0
:: ‹ ('s ⇒ ('b,'c) φ) ⇒ ('s2 ⇒ ('b2,'c2) φ) ⇒ bool ›
where ‹ Type_Variant_of_the_Same_Scalar_Mul⇩0 Fa Fb ⟷ True ›
definition Type_Variant_of_the_Same_Scalar_Mul
:: ‹ ('s ⇒ 'a ⇒ ('b,'c) φ) ⇒ ('s2 ⇒ 'a2 ⇒ ('b2,'c2) φ) ⇒ bool ›
where ‹ Type_Variant_of_the_Same_Scalar_Mul Fa Fb ⟷ True ›
definition Parameter_Variant_of_the_Same_Type :: ‹ 'a ⇒ 'b ⇒ bool ›
where ‹ Parameter_Variant_of_the_Same_Type Fa Fb ⟷ True ›
definition Parameter_Variant_of_the_Same_TypOpr
:: ‹ ('p ⇒ ('a,'b) φ) ⇒ ('p2 ⇒ ('c,'d) φ) ⇒ bool ›
where ‹ Parameter_Variant_of_the_Same_TypOpr Fa Fb ⟷ True ›
declare [[
φreason_default_pattern
‹Type_Variant_of_the_Same_Type_Operator ?Fa ?Fb› ⇒
‹Type_Variant_of_the_Same_Type_Operator ?Fa _›
‹Type_Variant_of_the_Same_Type_Operator _ ?Fb› (100)
and ‹Type_Variant_of_the_Same_Type_Operator2 ?Fa ?Fb› ⇒
‹Type_Variant_of_the_Same_Type_Operator2 ?Fa _›
‹Type_Variant_of_the_Same_Type_Operator2 _ ?Fb› (100)
and ‹Type_Variant_of_the_Same_Scalar_Mul ?Fa ?Fb› ⇒
‹Type_Variant_of_the_Same_Scalar_Mul ?Fa _›
‹Type_Variant_of_the_Same_Scalar_Mul _ ?Fb› (100)
and ‹Type_Variant_of_the_Same_Scalar_Mul⇩0 ?Fa ?Fb› ⇒
‹Type_Variant_of_the_Same_Scalar_Mul⇩0 ?Fa _›
‹Type_Variant_of_the_Same_Scalar_Mul⇩0 _ ?Fb› (100)
and ‹Parameter_Variant_of_the_Same_Type ?Fa ?Fb› ⇒
‹Parameter_Variant_of_the_Same_Type ?Fa _›
‹Parameter_Variant_of_the_Same_Type _ ?Fb› (100)
and ‹Parameter_Variant_of_the_Same_TypOpr ?Fa ?Fb› ⇒
‹Parameter_Variant_of_the_Same_TypOpr ?Fa _›
‹Parameter_Variant_of_the_Same_TypOpr _ ?Fb› (100)
]]
φreasoner_group variants_of_type_opr = (%cutting, [%cutting, %cutting])
for (‹Type_Variant_of_the_Same_Type_Operator F F'›,
‹Type_Variant_of_the_Same_Type_Operator2 F F'›,
‹Type_Variant_of_the_Same_Scalar_Mul⇩0 F F'›,
‹Type_Variant_of_the_Same_Scalar_Mul F F'›,
‹Parameter_Variant_of_the_Same_Type F F'›)
‹variants_of_type_opr›
and variants_of_type_opr_overrided = (%cutting+10, [%cutting+10, %cutting+10]) > variants_of_type_opr ‹›
lemma Type_Variant_of_the_Same_Type_Operator_I:
‹Type_Variant_of_the_Same_Type_Operator Fa Fb›
unfolding Type_Variant_of_the_Same_Type_Operator_def ..
lemma Type_Variant_of_the_Same_Type_Operator2_I:
‹Type_Variant_of_the_Same_Type_Operator2 Fa Fb›
unfolding Type_Variant_of_the_Same_Type_Operator2_def ..
lemma Type_Variant_of_the_Same_Scalar_Mul_I:
‹Type_Variant_of_the_Same_Scalar_Mul Fa Fb›
unfolding Type_Variant_of_the_Same_Scalar_Mul_def ..
lemma Type_Variant_of_the_Same_Scalar_Mul⇩0_I:
‹Type_Variant_of_the_Same_Scalar_Mul⇩0 Fa Fb›
unfolding Type_Variant_of_the_Same_Scalar_Mul⇩0_def ..
lemma Type_Variant_of_the_Same_Scalar_Mul⇩0_I':
‹ Type_Variant_of_the_Same_Scalar_Mul⇩0 (λs. Fa s T) (λs. Fb s U) ›
unfolding Type_Variant_of_the_Same_Scalar_Mul⇩0_def ..
ML_file ‹library/phi_type_algebra/variant_phi_type_instantiations.ML›
setup ‹
PLPR_Template_Properties.add_property_kinds [
\<^pattern_prop>‹Type_Variant_of_the_Same_Type_Operator _ _›,
\<^pattern_prop>‹Type_Variant_of_the_Same_Type_Operator2 _ _›,
\<^pattern_prop>‹Type_Variant_of_the_Same_Scalar_Mul _ _›,
\<^pattern_prop>‹Type_Variant_of_the_Same_Scalar_Mul⇩0 _ _›,
\<^pattern_prop>‹Parameter_Variant_of_the_Same_Type _ _›,
\<^pattern_prop>‹Parameter_Variant_of_the_Same_TypOpr _ _›
]
›
φreasoner_ML Parameter_Variant_of_the_Same_Type %variants_of_type_opr_overrided (‹Parameter_Variant_of_the_Same_Type _ ?var›) = ‹
fn (_, (ctxt, sequent)) => Seq.make (fn () =>
let val (bvtys, goal) = Phi_Help.strip_meta_hhf_bvtys (Phi_Help.leading_antecedent' sequent)
val _ $ (_ $ LHS $ var) = goal
val thy = Proof_Context.theory_of ctxt
val (Var (v, _), bargs) = strip_comb var
val barg_tys = map (fn x => fastype_of1 (bvtys, x)) bargs
exception Not_A_Phi_Type
fun parse lv bvs (X $ Bound i) =
if i < lv then parse lv (SOME i :: bvs) X else parse lv (NONE :: bvs) X
| parse lv bvs (X $ Y) = parse lv (NONE :: bvs) X
| parse lv bvs (Abs(_,_,X)) = parse (lv+1) (map (Option.map (fn i=>i+1)) bvs) X
| parse lv bvs (Const(N, _)) =
let val idx = Thm.maxidx_of sequent + 1
val ty = Logic.incr_tvar idx (Sign.the_const_type thy N )
val args = List.take (Term.binder_types ty, length bvs)
val a_num = length args
val b_num = length barg_tys
val parameterize = fold_index (fn (i,_) => fn X => X $ Bound (a_num+b_num-1-i)) barg_tys
val const = Const(N, ty)
val (F0,bvs) = fold_index (
fn (_, (SOME b, ty)) => (fn (X,bvs) => (X $ Bound b, (b,ty)::bvs))
| (i, (NONE, ty)) => (fn (X,bvs) => (X $ parameterize (Var (("x",idx+i), barg_tys ---> ty)), bvs))
) (bvs ~~ args) (const, [])
val F = fold_index (fn (i,_) => fn X =>
case AList.lookup (op =) bvs i
of SOME ty => Abs ("_", ty, X)
| NONE => raise Not_A_Phi_Type
) bvs F0
|> fold_rev (fn ty => fn X => Abs ("_", ty, X)) barg_tys
|> Thm.cterm_of ctxt
in Drule.infer_instantiate ctxt [(v, F)] sequent
|> (fn th => @{lemma' ‹Parameter_Variant_of_the_Same_Type A B›
by (simp add: Parameter_Variant_of_the_Same_Type_def)} RS th)
|> (fn th => SOME ((ctxt,th), Seq.empty))
end
in parse 0 [] LHS
end
) ›
subsection ‹Auxiliary›
definition SE_Has_or_Not
where ‹SE_Has_or_Not C W F FW ⟷ (if C then FW = F W else W = ○ ∧ FW = ○)›
definition SE_Has_or_Not⇩2
where ‹SE_Has_or_Not⇩2 C W⇩1 W⇩2 F FW ⟷ (if C then FW = F W⇩1 W⇩2 else W⇩1 = ○ ∧ W⇩2 = ○ ∧ FW = ○)›
definition SE_Has_or_Not⇩Λ
where ‹SE_Has_or_Not⇩Λ C W F FW ⟷ (if C then FW = F W else (∀a. W a = ○) ∧ FW = ○)›
φreasoner_group
SE_Has_or_Not_all = (100, [10,2000]) ‹›
and SE_Has_or_Not = (1000, [1000,1030]) in SE_Has_or_Not_all ‹›
and SE_Has_or_Not_default = (30, [10,50]) in SE_Has_or_Not_all ‹›
declare [[ φreason_default_pattern
‹SE_Has_or_Not _ ?W ?F _› ⇒ ‹SE_Has_or_Not _ ?W ?F _› (100)
and ‹SE_Has_or_Not⇩Λ _ ?W ?F _› ⇒ ‹SE_Has_or_Not⇩Λ _ ?W ?F _› (100)
and ‹SE_Has_or_Not⇩2 _ ?W1 ?W2 ?F _› ⇒ ‹SE_Has_or_Not⇩2 _ ?W1 ?W2 ?F _› (100)
]]
lemma SE_Has_or_Not_alt_def:
‹ SE_Has_or_Not C W F FW ⟷ ◒[C] W = W ∧ ◒[C] F W = FW ›
unfolding SE_Has_or_Not_def
by simp blast
lemma SE_Has_or_Not⇩2_alt_def:
‹ SE_Has_or_Not⇩2 C W1 W2 F FW ⟷ ◒[C] W1 = W1 ∧ ◒[C] W2 = W2 ∧ ◒[C] F W1 W2 = FW ›
unfolding SE_Has_or_Not⇩2_def
by simp blast
lemma SE_Has_or_Not⇩Λ_alt_def:
‹ SE_Has_or_Not⇩Λ C W F FW ⟷ (∀a. ◒[C] W a = W a) ∧ ◒[C] F W = FW ›
unfolding SE_Has_or_Not⇩Λ_def
by simp fastforce
lemma SE_Has_or_Not_None[φreason %SE_Has_or_Not + 10]:
‹ SE_Has_or_Not False ○ F ○ ›
unfolding SE_Has_or_Not_def
by (simp add: φNone_def)
lemma SE_Has_or_Not⇩Λ_None[φreason %SE_Has_or_Not + 10]:
‹ SE_Has_or_Not⇩Λ False (λ_. ○) F ○ ›
unfolding SE_Has_or_Not⇩Λ_def
by (simp add: φNone_def)
lemma SE_Has_or_Not⇩2_None[φreason %SE_Has_or_Not + 10]:
‹ SE_Has_or_Not⇩2 False ○ ○ F ○ ›
unfolding SE_Has_or_Not⇩2_def
by (simp add: φNone_def)
lemma [φreason %SE_Has_or_Not]:
‹ SE_Has_or_Not True W F (F W) ›
unfolding SE_Has_or_Not_def
by simp
lemma [φreason %SE_Has_or_Not]:
‹ SE_Has_or_Not⇩2 True W1 W2 F (F W1 W2) ›
unfolding SE_Has_or_Not⇩2_def
by simp
lemma [φreason %SE_Has_or_Not]:
‹ SE_Has_or_Not⇩Λ True W F (F W) ›
unfolding SE_Has_or_Not⇩Λ_def
by simp
lemma [φreason default %SE_Has_or_Not_default]:
‹ SE_Has_or_Not C F W FW
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 FW = FW'
⟹ SE_Has_or_Not C F W FW' ›
unfolding Premise_def
by simp
lemma [φreason default %SE_Has_or_Not_default]:
‹ SE_Has_or_Not⇩2 C F W1 W2 FW
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 FW = FW'
⟹ SE_Has_or_Not⇩2 C F W1 W2 FW' ›
unfolding Premise_def
by simp
lemma [φreason default %SE_Has_or_Not_default]:
‹ SE_Has_or_Not⇩Λ C F W FW
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 FW = FW'
⟹ SE_Has_or_Not⇩Λ C F W FW' ›
unfolding Premise_def
by simp
subsection ‹Transformation Functor›
lemma [φreason_template name Fa.simp_cong [φsimp_cong]]:
‹ Transformation_Functor Fa Fa T U (λx. {x}) (λx. ⊤) (λx. x)
⟹ Transformation_Functor Fa Fa U T (λx. {x}) (λx. ⊤) (λx. x)
⟹ PROP NO_SIMP' ((x ⦂ T) ≡ (x' ⦂ U))
⟹ (x ⦂ Fa T) ≡ (x' ⦂ Fa U)›
unfolding Transformation_Functor_def Transformation_def atomize_eq NO_SIMP'_def
apply (auto simp add: BI_eq_iff)
subgoal premises prems for xa
using prems(1)[THEN spec[where x=x], THEN spec[where x=‹λ_ c. c = x'›], simplified]
using prems(3) prems(4) by blast
subgoal premises prems for xa
using prems(2)[THEN spec[where x=x'], THEN spec[where x=‹λ_ c. c = x›], simplified]
using prems(3) prems(4) by blast
.
lemma transformation[φreason_template name Fa.transformation []]:
‹ 𝗀𝗎𝖺𝗋𝖽 Transformation_Functor Fa Fb T U D R mapper
⟹ (⋀a ∈ D x. a ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U 𝗌𝗎𝖻𝗃 b. g a b)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀a b. a ∈ D x ∧ g a b ⟶ b ∈ R x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U 𝗌𝗎𝖻𝗃 y. mapper g x y ›
unfolding meta_Ball_def Premise_def 𝗋Guard_def Transformation_Functor_def Action_Tag_def
by clarsimp
lemma [φreason_template default %To_ToA_derived_Tr_functor name Fa.To_Transformation]:
‹ 𝗀𝗎𝖺𝗋𝖽 Transformation_Functor Fa Fb T U D R mapper
⟹ (⋀a ∈ D x. a ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U 𝗌𝗎𝖻𝗃 b. g a b @tag to Z)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀a b. a ∈ D x ∧ g a b ⟶ b ∈ R x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U 𝗌𝗎𝖻𝗃 y. mapper g x y @tag to (Fb Z) ›
unfolding Action_Tag_def 𝗋Guard_def
using transformation[unfolded 𝗋Guard_def Action_Tag_def,
where Fa=Fa and Fb=Fb and D=D and R=R and mapper=mapper] .
lemma [φreason_template default %To_ToA_derived_Tr_functor_fuzzy name Fa.To_Transformation_fuzzy]:
‹ NO_SIMP (𝗀𝗎𝖺𝗋𝖽 NO_MATCH TYPE('c⇩a⇩a) TYPE('c))
⟹ 𝗀𝗎𝖺𝗋𝖽 Transformation_Functor Fa Fb T U D R mapper
⟹ (⋀a ∈ D x. a ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U 𝗌𝗎𝖻𝗃 b. g a b @tag to Z)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀a b. a ∈ D x ∧ g a b ⟶ b ∈ R x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U 𝗌𝗎𝖻𝗃 y. mapper g x y @tag to Z
<except-pattern> (XX::'c⇩a⇩a BI) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 YY 𝗐𝗂𝗍𝗁 PP @tag to Z ›
for Fa :: ‹('c⇩a, 'a⇩a) φ ⇒ ('c,'a) φ› and Z :: ‹('c⇩a⇩a, 'a⇩a⇩a) φ›
unfolding Action_Tag_def 𝗋Guard_def Except_Pattern_def
using transformation[unfolded 𝗋Guard_def Action_Tag_def,
where Fa=Fa and Fb=Fb and D=D and R=R and mapper=mapper] .
lemma [φreason_template default %To_ToA_derived_Tr_functor name Fa.to_traverse]:
‹ 𝗀𝗎𝖺𝗋𝖽 Transformation_Functor Fa Fb T U D R mapper
⟹ (⋀a ∈ D x. a ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U 𝗌𝗎𝖻𝗃 b. g a b @tag to (𝗍𝗋𝖺𝗏𝖾𝗋𝗌𝖾 Z))
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀a b. a ∈ D x ∧ g a b ⟶ b ∈ R x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U 𝗌𝗎𝖻𝗃 y. mapper g x y @tag to (𝗍𝗋𝖺𝗏𝖾𝗋𝗌𝖾 Z) ›
unfolding Action_Tag_def 𝗋Guard_def
using transformation[unfolded 𝗋Guard_def Action_Tag_def,
where Fa=Fa and Fb=Fb and D=D and R=R and mapper=mapper] .
lemma [φreason_template name Fa.𝒜simp [φtransformation_based_simp default %φsimp_derived_Tr_functor no trigger]]:
‹ 𝗀𝗎𝖺𝗋𝖽 Transformation_Functor Fa Fb T U D R mapper
⟹ 𝗀𝗎𝖺𝗋𝖽 (∀a ∈ D x. (a ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U 𝗌𝗎𝖻𝗃 b. g a b @tag 𝒜simp))
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (∀a b. a ∈ D x ∧ g a b ⟶ b ∈ R x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U 𝗌𝗎𝖻𝗃 y. mapper g x y @tag 𝒜_transitive_simp ›
unfolding Action_Tag_def Premise_def 𝗋Guard_def
using transformation[unfolded atomize_Ball Premise_def 𝗋Guard_def Action_Tag_def,
where Fa=Fa and Fb=Fb and D=D and R=R and mapper=mapper] .
lemma [φreason_template name Fa.𝒜backward_simp [φtransformation_based_backward_simp default %φsimp_derived_Tr_functor no trigger]]:
‹ 𝗀𝗎𝖺𝗋𝖽 Transformation_Functor Fa Fb T U D R mapper
⟹ 𝗀𝗎𝖺𝗋𝖽 (∀a ∈ D x. (a ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U 𝗌𝗎𝖻𝗃 b. g a b @tag 𝒜backward_simp))
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (∀a b. a ∈ D x ∧ g a b ⟶ b ∈ R x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U 𝗌𝗎𝖻𝗃 y. mapper g x y @tag 𝒜_backward_transitive_simp ›
unfolding Action_Tag_def Premise_def 𝗋Guard_def
using transformation[unfolded atomize_Ball Premise_def 𝗋Guard_def Action_Tag_def,
where Fa=Fa and Fb=Fb and D=D and R=R and mapper=mapper] .
lemma [no_atp, φreason_template default %ToA_derived_one_to_one_functor name Fa.functional_transformation]:
‹ 𝗀𝗎𝖺𝗋𝖽 Functional_Transformation_Functor Fa Fb T U D R pred_mapper func_mapper
⟹ (⋀a ∈ D x. a ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f a ⦂ U 𝗐𝗂𝗍𝗁 P a @tag 𝒯𝒫 )
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀a. a ∈ D x ⟶ f a ∈ R x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 func_mapper f P x ⦂ Fb U 𝗐𝗂𝗍𝗁 pred_mapper f P x @tag 𝒯𝒫 ›
unfolding 𝗋Guard_def Action_Tag_def
using apply_Functional_Transformation_Functor[unfolded Argument_def,
where func_mapper=func_mapper and pred_mapper=pred_mapper] .
subsection ‹Bi-Transformation Functor›
lemma bitransformation[φreason_template name Fa.bitransformation []]:
‹ 𝗀𝗎𝖺𝗋𝖽 Transformation_BiFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 mapper
⟹ (⋀a ∈ D⇩1 x. a ⦂ T⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩1 𝗌𝗎𝖻𝗃 b. g⇩1 a b)
⟹ (⋀a ∈ D⇩2 x. a ⦂ T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩2 𝗌𝗎𝖻𝗃 b. g⇩2 a b)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀a b. a ∈ D⇩1 x ∧ g⇩1 a b ⟶ b ∈ R⇩1 x) ∧ (∀a b. a ∈ D⇩2 x ∧ g⇩2 a b ⟶ b ∈ R⇩2 x)
⟹ x ⦂ Fa T⇩1 T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U⇩1 U⇩2 𝗌𝗎𝖻𝗃 y. mapper g⇩1 g⇩2 x y›
unfolding meta_Ball_def Premise_def 𝗋Guard_def Transformation_BiFunctor_def
Transformation_def
by clarsimp
lemma [φreason_template default %To_ToA_derived_Tr_functor name Fa.To_BiTransformation]:
‹ 𝗀𝗎𝖺𝗋𝖽 Transformation_BiFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 mapper
⟹ (⋀a ∈ D⇩1 x. a ⦂ T⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩1 𝗌𝗎𝖻𝗃 b. g⇩1 a b @tag to Z⇩1)
⟹ (⋀a ∈ D⇩2 x. a ⦂ T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩2 𝗌𝗎𝖻𝗃 b. g⇩2 a b @tag to Z⇩2)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀a b. a ∈ D⇩1 x ∧ g⇩1 a b ⟶ b ∈ R⇩1 x) ∧ (∀a b. a ∈ D⇩2 x ∧ g⇩2 a b ⟶ b ∈ R⇩2 x)
⟹ x ⦂ Fa T⇩1 T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U⇩1 U⇩2 𝗌𝗎𝖻𝗃 y. mapper g⇩1 g⇩2 x y @tag to (Fb Z⇩1 Z⇩2) ›
unfolding Action_Tag_def 𝗋Guard_def
using bitransformation[unfolded 𝗋Guard_def, where Fa=Fa and Fb=Fb and D⇩1=D⇩1 and D⇩2=D⇩2 and mapper=mapper] .
lemma [φreason_template default %To_ToA_derived_Tr_functor name Fa.to_bitraverse]:
‹ 𝗀𝗎𝖺𝗋𝖽 Transformation_BiFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 mapper
⟹ (⋀a ∈ D⇩1 x. a ⦂ T⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩1 𝗌𝗎𝖻𝗃 b. g⇩1 a b @tag to (𝗍𝗋𝖺𝗏𝖾𝗋𝗌𝖾 Z⇩1))
⟹ (⋀a ∈ D⇩2 x. a ⦂ T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩2 𝗌𝗎𝖻𝗃 b. g⇩2 a b @tag to (𝗍𝗋𝖺𝗏𝖾𝗋𝗌𝖾 Z⇩2))
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀a b. a ∈ D⇩1 x ∧ g⇩1 a b ⟶ b ∈ R⇩1 x) ∧ (∀a b. a ∈ D⇩2 x ∧ g⇩2 a b ⟶ b ∈ R⇩2 x)
⟹ x ⦂ Fa T⇩1 T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U⇩1 U⇩2 𝗌𝗎𝖻𝗃 y. mapper g⇩1 g⇩2 x y @tag to (𝗍𝗋𝖺𝗏𝖾𝗋𝗌𝖾 Fb Z⇩1 Z⇩2) ›
unfolding Action_Tag_def 𝗋Guard_def
using bitransformation[unfolded 𝗋Guard_def, where Fa=Fa and Fb=Fb and D⇩1=D⇩1 and D⇩2=D⇩2 and mapper=mapper] .
lemma [φreason_template name Fa.𝒜simp_bi [φtransformation_based_simp default %φsimp_derived_Tr_functor no trigger]]:
‹ 𝗀𝗎𝖺𝗋𝖽 Transformation_BiFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 mapper
⟹ 𝗀𝗎𝖺𝗋𝖽 (∀a ∈ D⇩1 x. (a ⦂ T⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩1 𝗌𝗎𝖻𝗃 b. g⇩1 a b @tag 𝒜try_simp M1))
⟹ 𝗀𝗎𝖺𝗋𝖽 (∀a ∈ D⇩2 x. (a ⦂ T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩2 𝗌𝗎𝖻𝗃 b. g⇩2 a b @tag 𝒜try_simp M2))
⟹ 𝗀𝗎𝖺𝗋𝖽 M1 ∨ M2
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (∀a b. a ∈ D⇩1 x ∧ g⇩1 a b ⟶ b ∈ R⇩1 x) ∧ (∀a b. a ∈ D⇩2 x ∧ g⇩2 a b ⟶ b ∈ R⇩2 x)
⟹ x ⦂ Fa T⇩1 T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U⇩1 U⇩2 𝗌𝗎𝖻𝗃 y. mapper g⇩1 g⇩2 x y @tag 𝒜_transitive_simp ›
unfolding Action_Tag_def Premise_def 𝗋Guard_def
using bitransformation[unfolded atomize_Ball 𝗋Guard_def Premise_def, where Fa=Fa and Fb=Fb and D⇩1=D⇩1 and D⇩2=D⇩2 and mapper=mapper] .
lemma [φreason_template name Fa.𝒜backward_simp_bi [φtransformation_based_backward_simp default %φsimp_derived_Tr_functor no trigger]]:
‹ 𝗀𝗎𝖺𝗋𝖽 Transformation_BiFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 mapper
⟹ 𝗀𝗎𝖺𝗋𝖽 (∀a ∈ D⇩1 x. (a ⦂ T⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩1 𝗌𝗎𝖻𝗃 b. g⇩1 a b @tag 𝒜try_backward_simp M1))
⟹ 𝗀𝗎𝖺𝗋𝖽 (∀a ∈ D⇩2 x. (a ⦂ T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩2 𝗌𝗎𝖻𝗃 b. g⇩2 a b @tag 𝒜try_backward_simp M2))
⟹ 𝗀𝗎𝖺𝗋𝖽 M1 ∨ M2
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (∀a b. a ∈ D⇩1 x ∧ g⇩1 a b ⟶ b ∈ R⇩1 x) ∧ (∀a b. a ∈ D⇩2 x ∧ g⇩2 a b ⟶ b ∈ R⇩2 x)
⟹ x ⦂ Fa T⇩1 T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U⇩1 U⇩2 𝗌𝗎𝖻𝗃 y. mapper g⇩1 g⇩2 x y @tag 𝒜_backward_transitive_simp ›
unfolding Action_Tag_def Premise_def 𝗋Guard_def
using bitransformation[unfolded atomize_Ball 𝗋Guard_def Premise_def, where Fa=Fa and Fb=Fb and D⇩1=D⇩1 and D⇩2=D⇩2 and mapper=mapper] .
lemma [no_atp, φreason_template default %ToA_derived_one_to_one_functor name Fa.functional_transformation]:
‹ 𝗀𝗎𝖺𝗋𝖽 Functional_Transformation_BiFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 pred_mapper func_mapper
⟹ (⋀a ∈ D⇩1 x. a ⦂ T⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f⇩1 a ⦂ U⇩1 𝗐𝗂𝗍𝗁 P⇩1 a @tag 𝒯𝒫 )
⟹ (⋀a ∈ D⇩2 x. a ⦂ T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f⇩2 a ⦂ U⇩2 𝗐𝗂𝗍𝗁 P⇩2 a @tag 𝒯𝒫 )
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀a. a ∈ D⇩1 x ⟶ f⇩1 a ∈ R⇩1 x) ∧ (∀a. a ∈ D⇩2 x ⟶ f⇩2 a ∈ R⇩2 x)
⟹ x ⦂ Fa T⇩1 T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 func_mapper f⇩1 f⇩2 P⇩1 P⇩2 x ⦂ Fb U⇩1 U⇩2 𝗐𝗂𝗍𝗁 pred_mapper f⇩1 f⇩2 P⇩1 P⇩2 x @tag 𝒯𝒫 ›
unfolding 𝗋Guard_def Action_Tag_def
using apply_Functional_Transformation_BiFunctor[unfolded Argument_def,
where func_mapper=func_mapper and pred_mapper=pred_mapper] .
lemma [no_atp, φreason_template default %ToA_derived_one_to_one_functor name Fa.functional_transformation]:
‹ 𝗀𝗎𝖺𝗋𝖽 Fun_CV_TrFunctor Fa Fb T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 FC⇩1 R⇩2 pred_mapper func_mapper
⟹ (⋀a. 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 f⇩1 a ∈ D⇩1 x ⟹ a ⦂ U⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f⇩1 a ⦂ T⇩1 𝗐𝗂𝗍𝗁 P⇩1 a @tag 𝒯𝒫 )
⟹ (⋀a ∈ D⇩2 x. a ⦂ T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f⇩2 a ⦂ U⇩2 𝗐𝗂𝗍𝗁 P⇩2 a @tag 𝒯𝒫 )
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 FC⇩1 f⇩1 x ∧ (∀a. a ∈ D⇩2 x ⟶ f⇩2 a ∈ R⇩2 x)
⟹ x ⦂ Fa T⇩1 T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 func_mapper f⇩1 f⇩2 P⇩1 P⇩2 x ⦂ Fb U⇩1 U⇩2 𝗐𝗂𝗍𝗁 pred_mapper f⇩1 f⇩2 P⇩1 P⇩2 x @tag 𝒯𝒫 ›
unfolding 𝗋Guard_def Action_Tag_def
using apply_Functional_CV_BiFunctor[unfolded Argument_def,
where func_mapper=func_mapper and pred_mapper=pred_mapper] .
subsection ‹Transformation Functor with Parameterization›
lemma transformation⇩Λ[φreason_template name Fa.transformation []]:
‹ 𝗀𝗎𝖺𝗋𝖽 Transformation_Functor⇩Λ Fa Fb T U D R mapper
⟹ (⋀p. ⋀a ∈ D p x. a ⦂ T p 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U p 𝗌𝗎𝖻𝗃 b. g p a b)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀p a b. a ∈ D p x ∧ g p a b ⟶ b ∈ R p x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U 𝗌𝗎𝖻𝗃 y. mapper g x y›
unfolding meta_Ball_def Premise_def 𝗋Guard_def Transformation_Functor⇩Λ_def
by clarsimp
lemma [φreason_template default %To_ToA_derived_Tr_functor name Fa.To_Transformation]:
‹ 𝗀𝗎𝖺𝗋𝖽 Transformation_Functor⇩Λ Fa Fb T U D R mapper
⟹ (⋀p. ⋀a ∈ D p x. a ⦂ T p 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U p 𝗌𝗎𝖻𝗃 b. g p a b @tag to (Z p))
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀p a b. a ∈ D p x ∧ g p a b ⟶ b ∈ R p x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U 𝗌𝗎𝖻𝗃 y. mapper g x y @tag to (Fb Z) ›
unfolding Action_Tag_def 𝗋Guard_def
using transformation⇩Λ[unfolded 𝗋Guard_def, where Fa=Fa and Fb=Fb and D=D and R=R and mapper=mapper] .
lemma [φreason_template default %To_ToA_derived_Tr_functor_fuzzy name Fa.To_Transformation_fuzzy]:
‹ NO_SIMP (𝗀𝗎𝖺𝗋𝖽 NO_MATCH TYPE('c⇩a⇩a) TYPE('c))
⟹ 𝗀𝗎𝖺𝗋𝖽 Transformation_Functor⇩Λ Fa Fb T U D R mapper
⟹ (⋀p. ⋀a ∈ D p x. a ⦂ T p 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U p 𝗌𝗎𝖻𝗃 b. g p a b @tag to Z)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀p a b. a ∈ D p x ∧ g p a b ⟶ b ∈ R p x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U 𝗌𝗎𝖻𝗃 y. mapper g x y @tag to Z
<except-pattern> (XX::'c⇩a⇩a BI) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 YY 𝗐𝗂𝗍𝗁 PP @tag to Z ›
for Fa :: ‹('p ⇒ ('c⇩a, 'a⇩a) φ) ⇒ ('c,'a) φ› and Z :: ‹('c⇩a⇩a, 'a⇩a⇩a) φ›
unfolding Action_Tag_def 𝗋Guard_def Except_Pattern_def
using transformation⇩Λ[unfolded 𝗋Guard_def, where Fa=Fa and Fb=Fb and D=D and R=R and mapper=mapper] .
lemma [φreason_template default %To_ToA_derived_Tr_functor name Fa.to_traverse]:
‹ 𝗀𝗎𝖺𝗋𝖽 Transformation_Functor⇩Λ Fa Fb T U D R mapper
⟹ (⋀p. ⋀a ∈ D p x. a ⦂ T p 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U p 𝗌𝗎𝖻𝗃 b. g p a b @tag to (𝗍𝗋𝖺𝗏𝖾𝗋𝗌𝖾 Z))
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀p a b. a ∈ D p x ∧ g p a b ⟶ b ∈ R p x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U 𝗌𝗎𝖻𝗃 y. mapper g x y @tag to (𝗍𝗋𝖺𝗏𝖾𝗋𝗌𝖾 Z) ›
unfolding Action_Tag_def 𝗋Guard_def
using transformation⇩Λ[unfolded 𝗋Guard_def, where Fa=Fa and Fb=Fb and D=D and R=R and mapper=mapper] .
lemma [φreason_template name Fa.𝒜simp [φtransformation_based_simp default %φsimp_derived_Tr_functor no trigger]]:
‹ 𝗀𝗎𝖺𝗋𝖽 Transformation_Functor⇩Λ Fa Fb T U D R mapper
⟹ 𝗀𝗎𝖺𝗋𝖽 (∀p. ∀a ∈ D p x. (a ⦂ T p 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U p 𝗌𝗎𝖻𝗃 b. g p a b @tag 𝒜simp))
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (∀p a b. a ∈ D p x ∧ g p a b ⟶ b ∈ R p x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U 𝗌𝗎𝖻𝗃 y. mapper g x y @tag 𝒜_transitive_simp ›
unfolding Action_Tag_def Premise_def 𝗋Guard_def
using transformation⇩Λ[unfolded atomize_Ball atomize_all Premise_def 𝗋Guard_def, where Fa=Fa and Fb=Fb and D=D and R=R and mapper=mapper] .
lemma [φreason_template name Fa.𝒜backward_simp [φtransformation_based_backward_simp default %φsimp_derived_Tr_functor no trigger]]:
‹ 𝗀𝗎𝖺𝗋𝖽 Transformation_Functor⇩Λ Fa Fb T U D R mapper
⟹ 𝗀𝗎𝖺𝗋𝖽 (∀p. ∀a ∈ D p x. (a ⦂ T p 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U p 𝗌𝗎𝖻𝗃 b. g p a b @tag 𝒜backward_simp))
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (∀p a b. a ∈ D p x ∧ g p a b ⟶ b ∈ R p x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fb U 𝗌𝗎𝖻𝗃 y. mapper g x y @tag 𝒜_backward_transitive_simp ›
unfolding Action_Tag_def Premise_def 𝗋Guard_def
using transformation⇩Λ[unfolded atomize_Ball atomize_all Premise_def 𝗋Guard_def, where Fa=Fa and Fb=Fb and D=D and R=R and mapper=mapper] .
lemma [no_atp, φreason_template default %ToA_derived_one_to_one_functor name Fa.functional_transformation]:
‹ 𝗀𝗎𝖺𝗋𝖽 Functional_Transformation_Functor⇩Λ Fa Fb T U D R pred_mapper func_mapper
⟹ (⋀p. ⋀a ∈ D p x. a ⦂ T p 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f p a ⦂ U p 𝗐𝗂𝗍𝗁 P p a @tag 𝒯𝒫 )
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀p a. a ∈ D p x ⟶ f p a ∈ R p x)
⟹ x ⦂ Fa T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 func_mapper f P x ⦂ Fb U 𝗐𝗂𝗍𝗁 pred_mapper f P x @tag 𝒯𝒫 ›
unfolding 𝗋Guard_def Action_Tag_def
using apply_Functional_Transformation_Functor⇩Λ[unfolded Argument_def,
where func_mapper=func_mapper and pred_mapper=pred_mapper] .
subsection ‹Separation Homomorphism›
lemma Object_Sep_Homo⇩I_subdom[
φadding_property = false,
φreason %φTA_varify_out except ‹Object_Sep_Homo⇩I _ ?var›,
φadding_property = true
]:
‹ Object_Sep_Homo⇩I T Da
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 Db ⊆ Da
⟹ Object_Sep_Homo⇩I T Db›
unfolding Object_Sep_Homo⇩I_def Premise_def subset_iff
by blast
lemma [φreason_template default %φsimp_derived_Tr_functor+5 name Fb.𝒜simp_sep_homo]:
‹ 𝗀𝗎𝖺𝗋𝖽 Separation_Homo⇩E Fa⇩L Fa⇩R Fb U⇩L U⇩R Du un
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x ∈ Du
⟹ x ⦂ Fb (U⇩L ∗⇩𝒜 U⇩R) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fa⇩L U⇩L ∗⇩𝒜 Fa⇩R U⇩R 𝗌𝗎𝖻𝗃 y. y = un x @tag 𝒜simp›
unfolding Separation_Homo⇩E_def Action_Tag_def Bubbling_def 𝗋Guard_def Premise_def
by (clarsimp simp: Subjection_transformation_rewr Ex_transformation_expn)
lemma Separation_Homo_functor[φreason_template default %Object_Sep_Homo_functor]:
‹ Separation_Homo⇩I F F F' T T Ds zz
⟹ Transformation_Functor F' F (T ∗ T) T D R m
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀x y z. m (λ(a, b) c. c = a * b ∧ a ## b ∧ (a, b) ∈ D (zz (x, y))) (zz (x, y)) z
⟶ z = x * y ∧ x ## y) ∧
(∀x y a b. (a, b) ∈ D (zz (x, y)) ⟶ a * b ∈ R (zz (x, y)))
⟹ Object_Sep_Homo⇩I T (Set.bind Ds (D o zz))
⟹ Object_Sep_Homo⇩I (F T) Ds›
unfolding Object_Sep_Homo⇩I_def Transformation_Functor_def Separation_Homo⇩I_def Premise_def
meta_Ball_def meta_case_prod_def split_paired_all
apply (simp (no_asm_use) add: φProd_expn'[symmetric] del: split_paired_All; clarify)
subgoal premises prems for x y
proof -
have t1: ‹∀a∈D (zz (x, y)). a ⦂ T ∗ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ T 𝗌𝗎𝖻𝗃 b. (case a of (a, b) ⇒ λc. c = a * b ∧ a ## b ∧ (a, b) ∈ D (zz (x, y))) b›
by (clarsimp, insert prems(3,6), blast)
from prems(2)[THEN spec[where x=‹zz (x,y)›],
THEN spec[where x=‹λ(a,b) c. c = a * b ∧ a ## b ∧ (a,b) ∈ D (zz (x,y))›],
THEN mp, OF t1]
prems(4)[THEN spec[where x=x], THEN spec[where x=y]]
prems(1,5,6)
show ?thesis
by (clarsimp simp add: Transformation_def, blast)
qed .
lemma [φreason_template name Fc.φProd_ty []]:
‹ Separation_Homo⇩I Ft Fu Fc T U UNIV (λx. x)
⟹ Separation_Homo⇩E Ft Fu Fc T U UNIV (λx. x)
⟹ Fc (T ∗ U) = Ft T ∗ Fu U ›
unfolding Separation_Homo⇩I_def Separation_Homo⇩E_def
by (rule φType_eqI_Tr ; simp add: split_paired_all)
lemma [φreason_template name F⇩T⇩U.φProd[]]:
‹ Separation_Homo⇩I F⇩T F⇩U F⇩T⇩U T U D⇩z f
⟹ Separation_Homo⇩E F⇩T F⇩U F⇩T⇩U T U D⇩u g
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 g (f x) = x ∧ x ∈ D⇩z ∧ f x ∈ D⇩u
⟹ (x ⦂ F⇩T T ∗ F⇩U U) = (f x ⦂ F⇩T⇩U (T ∗ U))›
unfolding Separation_Homo⇩E_def Separation_Homo⇩I_def Premise_def Transformation_def
BI_eq_iff
by (clarsimp; metis prod.collapse)
lemma [φreason_template default %φTA_derived_properties name Ft.Separation_Homo⇩I_Cond]:
‹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 C⇩W ⟹ Separation_Homo⇩I Ft Fu F3 T U D z)
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 ¬ C⇩W ⟹ Functional_Transformation_Functor Ft F3 T (T ∗ ◒[C⇩W] U) D' R' pred' func' )
⟹ Separation_Homo⇩I_Cond Ft Fu F3 C⇩W T U (?⇩Z⇩D[C⇩W] D D' R') (?⇩Z[C⇩W] z (λf. func' f (λ_. True))) ›
unfolding Separation_Homo⇩I_Cond_def Separation_Homo⇩I_def Premise_def Action_Tag_def Simplify_def
LPR_ctrl_def
by ((cases C⇩W; clarsimp),
insert apply_Functional_Transformation_Functor
[unfolded Argument_def Premise_def,
where Fa=Ft and Fb=F3 and func_mapper=func' and f=‹(λx. (x, unspec))› and
pred_mapper=pred' and P=‹λ_. True› and T=‹T› and U=‹T ∗ ◒[C⇩W] U› and
D=D' and R=R'],
clarsimp simp: φProd_expn', insert transformation_weaken, blast)
lemma [φreason_template default %φTA_derived_properties name Ft.Separation_Homo⇩E_Cond]:
‹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 C⇩R ⟹ Separation_Homo⇩E Ft Fu F3 T U Du uz)
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 ¬ C⇩R ⟹ Functional_Transformation_Functor F3 Ft (T ∗ ◒[C⇩R] U) T Dz R' pred' func' )
⟹ Separation_Homo⇩E_Cond Ft Fu F3 C⇩R T U (?⇩U⇩Z⇩D[C⇩R] Du Dz R') (?⇩U⇩Z[C⇩R] uz (λf. func' f (λ_. True))) ›
unfolding Separation_Homo⇩E_Cond_def Separation_Homo⇩E_def Premise_def Action_Tag_def Simplify_def
by ((cases C⇩R; clarsimp),
insert apply_Functional_Transformation_Functor[unfolded Argument_def Premise_def,
where Fa=F3 and Fb=Ft and func_mapper=func' and f=‹fst› and
pred_mapper=pred' and P=‹λ_. True› and U=‹T› and T=‹T ∗ ◒[C⇩R] U› and
D=Dz and R=R'];
clarsimp simp: φProd_expn' φProd_expn'',
metis case_prod_conv transformation_weaken)
subsubsection ‹With Parameterization›
lemma [φreason_template default %φsimp_derived_Tr_functor+5 name Fb.𝒜simp_sep_homo]:
‹ 𝗀𝗎𝖺𝗋𝖽 Separation_Homo⇩Λ⇩E Fa⇩L Fa⇩R Fb U⇩L U⇩R Du un
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x ∈ Du
⟹ x ⦂ Fb (λp. U⇩L p ∗⇩𝒜 U⇩R p) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fa⇩L U⇩L ∗⇩𝒜 Fa⇩R U⇩R 𝗌𝗎𝖻𝗃 y. y = un x @tag 𝒜simp›
unfolding Separation_Homo⇩Λ⇩E_def Action_Tag_def Bubbling_def 𝗋Guard_def Premise_def
by (clarsimp simp: Subjection_transformation_rewr Ex_transformation_expn)
lemma [φreason_template name Fc.φProd_ty []]:
‹ Separation_Homo⇩Λ⇩I Ft Fu Fc T U UNIV (λx. x)
⟹ Separation_Homo⇩Λ⇩E Ft Fu Fc T U UNIV (λx. x)
⟹ Fc (λp. T p ∗ U p) = Ft T ∗ Fu U ›
unfolding Separation_Homo⇩Λ⇩I_def Separation_Homo⇩Λ⇩E_def
by (rule φType_eqI_Tr ; simp add: split_paired_all)
lemma [φreason_template name F⇩T⇩U.φProd[]]:
‹ Separation_Homo⇩Λ⇩I F⇩T F⇩U F⇩T⇩U T U D⇩z f
⟹ Separation_Homo⇩Λ⇩E F⇩T F⇩U F⇩T⇩U T U D⇩u g
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x ∈ D⇩z ∧ g (f x) = x ∧ f x ∈ D⇩u
⟹ (x ⦂ F⇩T T ∗ F⇩U U) = (f x ⦂ F⇩T⇩U (λp. T p ∗ U p))›
unfolding Separation_Homo⇩Λ⇩E_def Separation_Homo⇩Λ⇩I_def Premise_def
Transformation_def BI_eq_iff
by (clarsimp; metis (no_types, lifting) prod.collapse)
lemma [φreason_template default %φTA_derived_properties name Ft.Separation_Homo⇩I_Cond]:
‹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 C⇩W ⟹ Separation_Homo⇩Λ⇩I Ft Fu F3 T U D z)
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 ¬ C⇩W ⟹ Functional_Transformation_Functor⇩Λ Ft F3 T (λp. T p ∗ ◒[C⇩W] U p) D' R' pred' func' )
⟹ (𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φinstantiation] DD : (if LPR_ctrl C⇩W then D else {x. ∀p a. a ∈ D' p (fst x) ⟶ (a, unspec) ∈ R' p (fst x)})) @tag 𝒜_template_reason undefined
⟹ (𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φinstantiation] ZZ : (if LPR_ctrl C⇩W then z else func' (λ_ x. (x, unspec)) (λ_ _. True) o fst)) @tag 𝒜_template_reason undefined
⟹ Separation_Homo⇩Λ⇩I_Cond Ft Fu F3 C⇩W T U DD ZZ ›
unfolding Separation_Homo⇩Λ⇩I_Cond_def Separation_Homo⇩Λ⇩I_def Premise_def Action_Tag_def Simplify_def
LPR_ctrl_def
by (cases C⇩W; clarsimp;
insert apply_Functional_Transformation_Functor⇩Λ
[unfolded Argument_def Premise_def,
where Fa=Ft and Fb=F3 and func_mapper=func' and f=‹λ_ x. (x, unspec)› and
pred_mapper=pred' and P=‹λ_ _. True› and T=T and U=‹λp. T p ∗ ◒[C⇩W] U p› and
D=D' and R=R'];
clarsimp simp: φProd_expn';
insert transformation_weaken; blast)
lemma [φreason_template default %φTA_derived_properties name Ft.Separation_Homo⇩E_Cond]:
‹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 C⇩R ⟹ Separation_Homo⇩Λ⇩E Ft Fu F3 T U Du uz)
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 ¬ C⇩R ⟹ Functional_Transformation_Functor⇩Λ F3 Ft (λp. T p ∗ ◒[C⇩R] U p) T D' R' pred' func' )
⟹ (𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φinstantiation] DD : (if LPR_ctrl C⇩R then Du else {x. ∀p. ∀(a,b) ∈ D' p x. a ∈ R' p x})) @tag 𝒜_template_reason undefined
⟹ (𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φinstantiation] UZ : (if LPR_ctrl C⇩R then uz else (λx. (func' (λ_. fst) (λ_ _. True) x, unspec)))) @tag 𝒜_template_reason undefined
⟹ Separation_Homo⇩Λ⇩E_Cond Ft Fu F3 C⇩R T U DD UZ ›
unfolding Separation_Homo⇩Λ⇩E_Cond_def Separation_Homo⇩Λ⇩E_def Premise_def Action_Tag_def Simplify_def
by (cases C⇩R; clarsimp;
insert apply_Functional_Transformation_Functor⇩Λ[unfolded Argument_def Premise_def,
where Fa=F3 and Fb=Ft and func_mapper=func' and f=‹λ_. fst› and
pred_mapper=pred' and P=‹λ_ _. True› and U=T and T=‹λp. T p ∗ ◒[C⇩R] U p› and
D=D' and R=R'];
clarsimp simp: φProd_expn' φProd_expn'';
metis (no_types, lifting) case_prodD transformation_weaken)
subsection ‹Semimodule›
subsubsection ‹Zero›
lemma [φadding_property = false,
φreason default %φTA_fallback_lattice,
φadding_property = true]:
‹ Closed_Module_Zero F zero
⟹ Module_Zero F zero ›
unfolding Closed_Module_Zero_def Module_Zero_def
by simp
paragraph ‹Equations›
lemma [φreason_template name F.scalar_zero [assertion_simps, simp]]:
‹ Closed_Module_Zero F zero
⟹ (x ⦂ F zero) = 1 ›
unfolding Closed_Module_Zero_def by blast
lemma [φreason_template name F.scalar_zero' [assertion_simps, simp]]:
‹ Closed_Module_Zero F zero
⟹ (𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 zero' : zero) @tag 𝒜_template_reason undefined
⟹ NO_MATCH zero zero' @tag 𝒜_template_reason None
⟹ (x ⦂ F zero') = 1 ›
unfolding Closed_Module_Zero_def Simplify_def Action_Tag_def
by blast
paragraph ‹Identity Elements›
lemma [φreason_template default %derived_identity_element+5]:
‹ 𝗀𝗎𝖺𝗋𝖽 Closed_Module_Zero F zero
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 zero' = zero
⟹ Identity_Elements⇩E (F zero') (λ_. True) ›
unfolding Identity_Elements⇩E_def Identity_Element⇩E_def 𝗋Guard_def
Transformation_def Premise_def Closed_Module_Zero_def
by clarsimp
lemma [φreason_template default %derived_identity_element+5]:
‹ 𝗀𝗎𝖺𝗋𝖽 Module_Zero F zero
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 zero' = zero
⟹ Identity_Elements⇩I (F zero') (λ_. True) (λ_. True) ›
unfolding Identity_Elements⇩I_def Identity_Element⇩I_def 𝗋Guard_def
Transformation_def Premise_def Module_Zero_def
by clarsimp
paragraph ‹Transformations›
lemma [φreason_template default %ToA_derived_red]:
‹ Module_Zero F zero
⟹ NO_SIMP (1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y @tag 𝒯𝒫)
⟹ NO_SIMP (x ⦂ F zero 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y @tag 𝒯𝒫) ›
unfolding Module_Zero_def NO_SIMP_def Action_Tag_def
using mk_elim_transformation by blast
lemma [φreason_template default %ToA_derived_red ]:
‹ Module_Zero F zero
⟹ NO_SIMP (R 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y @tag 𝒯𝒫)
⟹ NO_SIMP ((x ⦂ F zero) * R 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y @tag 𝒯𝒫) ›
for R :: ‹'c::sep_magma_1 BI›
unfolding Module_Zero_def NO_SIMP_def Action_Tag_def
using transformation_bi_frame
by fastforce
lemma [φreason_template default %ToA_derived_red]:
‹ Module_Zero F zero
⟹ NO_SIMP (apfst (λ_. unspec) x ⦂ ○ ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y @tag 𝒯𝒫')
⟹ NO_SIMP (x ⦂ F zero ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y @tag 𝒯𝒫') ›
for W :: ‹('c::sep_magma_1, 'x) φ›
unfolding Module_Zero_def NO_SIMP_def Action_Tag_def φProd'_def
by (cases x; clarsimp simp: φProd_expn'; insert transformation_bi_frame; fastforce)
lemma [φreason_template default %ToA_derived_red]:
‹ Closed_Module_Zero F zero
⟹ NO_SIMP (X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 1 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫)
⟹ NO_SIMP (X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ F zero 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫) ›
unfolding Closed_Module_Zero_def Identity_Element⇩I_def NO_SIMP_def
by simp
lemma [φreason_template default %ToA_derived_red]:
‹ Closed_Module_Zero F zero
⟹ NO_SIMP (X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 1 𝗋𝖾𝗆𝖺𝗂𝗇𝗌 R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫)
⟹ NO_SIMP (X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ F zero 𝗋𝖾𝗆𝖺𝗂𝗇𝗌 R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫) ›
for R :: ‹'c::sep_magma_1 BI›
unfolding Closed_Module_Zero_def Identity_Element⇩I_def NO_SIMP_def
by simp
lemma [φreason_template default %ToA_derived_red]:
‹ Closed_Module_Zero F zero
⟹ NO_SIMP (X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ ○ ✼ R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫')
⟹ NO_SIMP (X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 (any, snd x) ⦂ F zero ✼ R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫') ›
unfolding Closed_Module_Zero_def Identity_Element⇩I_def NO_SIMP_def φProd'_def
by (clarsimp simp add: φProd_expn'' φProd_expn')
subsubsection ‹One›
paragraph ‹Rewrites Eliminating Identity Scalar›
lemma [φreason_template name F.scalar_one_ty [assertion_simps, simp]]:
‹ Module_One⇩I F T⇩1 one (λ_. True) (λx. x) P⇩I
⟹ Module_One⇩E F T⇩1 one (λ_. True) (λx. x) P⇩E
⟹ F one = T⇩1 ›
unfolding Module_One⇩I_def Module_One⇩E_def
by (rule φType_eqI_Tr; clarsimp simp add: Transformation_def)
lemma [φreason_template name F.scalar_one_ty' [assertion_simps, simp]]:
‹ Module_One⇩I F T⇩1 one (λ_. True) (λx. x) P⇩I
⟹ Module_One⇩E F T⇩1 one (λ_. True) (λx. x) P⇩E
⟹ (𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 one' : one) @tag 𝒜_template_reason undefined
⟹ NO_MATCH one one' @tag 𝒜_template_reason None
⟹ F one' = T⇩1 ›
unfolding Module_One⇩I_def Module_One⇩E_def Simplify_def Action_Tag_def
by (rule φType_eqI_Tr; clarsimp simp add: Transformation_def)
lemma [φreason_template name F.scalar_one [assertion_simps, simp]]:
‹ Module_One⇩I F T⇩1 one D⇩I f P⇩I
⟹ Module_One⇩E F T⇩1 one D⇩E g P⇩E
⟹ Object_Equiv (F one) eq @tag 𝒜_template_reason undefined
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D⇩E x ∧ D⇩I (g x) ∧ eq (f (g x)) x
⟹ (x ⦂ F one) = (g x ⦂ T⇩1) ›
unfolding Module_One⇩I_def Module_One⇩E_def BI_eq_iff Transformation_def Premise_def
Object_Equiv_def Action_Tag_def
by (clarsimp; metis)
lemma [φreason_template name F.scalar_one' [assertion_simps, simp]]:
‹ Module_One⇩I F T⇩1 one D⇩I f P⇩I
⟹ Module_One⇩E F T⇩1 one D⇩E g P⇩E
⟹ (𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 one' : one) @tag 𝒜_template_reason undefined
⟹ NO_MATCH one one' @tag 𝒜_template_reason None
⟹ Object_Equiv (F one) eq @tag 𝒜_template_reason undefined
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D⇩E x ∧ D⇩I (g x) ∧ eq (f (g x)) x
⟹ (x ⦂ F one') = (g x ⦂ T⇩1) ›
unfolding Module_One⇩I_def Module_One⇩E_def BI_eq_iff Transformation_def Premise_def
Simplify_def Action_Tag_def Object_Equiv_def
by (clarsimp; metis)
paragraph ‹Protector Preventing Eliminating the just Introduced Scalar Identity›
definition [iff, φsafe_simp]: ‹introduced X ≡ X›
subparagraph ‹arith_eval›
lemma [φreason %𝒜_partial_add_normalizing]:
‹ equation⇩3⇩1_cond C⇩d C⇩c a b ab c X
⟹ equation⇩3⇩1_cond C⇩d C⇩c a (introduced b) ab c X ›
by simp
lemma [φreason %𝒜_partial_add_normalizing]:
‹ equation⇩3⇩1_cond C⇩d C⇩c a b ab c X
⟹ equation⇩3⇩1_cond C⇩d C⇩c a b ab c (introduced X) ›
by simp
lemma [φreason %partial_add_overlaps_norm]:
‹ partial_add_overlaps a b
⟹ partial_add_overlaps (introduced a) b ›
by simp
lemma [φreason %partial_add_overlaps_norm]:
‹ partial_add_overlaps a b
⟹ partial_add_overlaps a (introduced b) ›
by simp
paragraph ‹ToA Eliminating Identity Scalar›
subparagraph ‹Implementation›
lemma [φreason_template default %ToA_derived_red]:
‹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩E F T⇩1 one D⇩E g P⇩E
⟹ 𝗀𝗎𝖺𝗋𝖽 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[𝗌𝖺𝖿𝖾] one'' : one'
⟹ 𝗀𝗎𝖺𝗋𝖽 is_id_element one (NO_SIMP one'')
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D⇩E x
⟹ NO_SIMP (g x ⦂ T⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫)
⟹ x ⦂ F one' 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P ∧ P⇩E x @tag 𝒯𝒫
<except-pattern> x ⦂ F (introduced one') 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 YYY 𝗐𝗂𝗍𝗁 PPP @tag 𝒯𝒫 ›
unfolding Module_One⇩I_def Module_One⇩E_def NO_SIMP_def 𝗋Guard_def Premise_def
Transformation_def Except_Pattern_def is_id_element_def Simplify_def Action_Tag_def
by (clarsimp; metis)
lemma [φreason_template default %ToA_derived_red]:
‹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩E F T⇩1 one D⇩E g P⇩E
⟹ 𝗀𝗎𝖺𝗋𝖽 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[𝗌𝖺𝖿𝖾] one'' : one'
⟹ 𝗀𝗎𝖺𝗋𝖽 is_id_element one (NO_SIMP one'')
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D⇩E x
⟹ NO_SIMP (R * (g x ⦂ T⇩1) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫)
⟹ R * (x ⦂ F one') 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P ∧ P⇩E x @tag 𝒯𝒫
<except-pattern> RRR * (x ⦂ F (introduced one')) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 YYY 𝗐𝗂𝗍𝗁 PPP @tag 𝒯𝒫 ›
unfolding Module_One⇩E_def NO_SIMP_def 𝗋Guard_def Premise_def Transformation_def
Except_Pattern_def is_id_element_def Simplify_def Action_Tag_def
by (clarsimp; metis)
lemma [φreason_template default %ToA_derived_red]:
‹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩E F T⇩1 one D g P⇩E
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D (fst x)
⟹ NO_SIMP (apfst g x ⦂ T⇩1 ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫')
⟹ x ⦂ F one ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P ∧ P⇩E (fst x) @tag 𝒯𝒫' ›
unfolding Module_One⇩E_def NO_SIMP_def 𝗋Guard_def Premise_def Transformation_def Action_Tag_def φProd'_def
by (cases x; clarsimp simp add: φProd_expn'; metis)
lemma [φreason_template default %ToA_derived_red]:
‹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩E F T⇩1 one D g P⇩E
⟹ (𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 one' : one) @tag 𝒜_template_reason undefined
⟹ NO_MATCH one one' @tag 𝒜_template_reason None
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D (fst x)
⟹ NO_SIMP (apfst g x ⦂ T⇩1 ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫')
⟹ x ⦂ F one' ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P ∧ P⇩E (fst x) @tag 𝒯𝒫' ›
unfolding Module_One⇩E_def NO_SIMP_def 𝗋Guard_def Premise_def Simplify_def Action_Tag_def Action_Tag_def
Transformation_def Except_Pattern_def φProd'_def
by (clarsimp simp add: φProd_expn'; metis)
lemma [φreason_template default %derived_SE_red_scalar_one]:
‹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩E F T⇩1 one D g P⇩E
⟹ 𝗀𝗎𝖺𝗋𝖽 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[𝗌𝖺𝖿𝖾] one'' : one'
⟹ 𝗀𝗎𝖺𝗋𝖽 is_id_element one (NO_SIMP one'')
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D (fst x)
⟹ NO_SIMP (apfst g x ⦂ T⇩1 ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫')
⟹ x ⦂ F one' ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P ∧ P⇩E (fst x) @tag 𝒯𝒫'
<except-pattern> x ⦂ F (introduced one') ✼ WWW 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 YYY 𝗐𝗂𝗍𝗁 PPP @tag 𝒯𝒫' ›
unfolding Module_One⇩E_def NO_SIMP_def 𝗋Guard_def Premise_def Transformation_def
Except_Pattern_def Simplify_def is_id_element_def Action_Tag_def φProd'_def
by (clarsimp simp add: φProd_expn'; metis)
lemma [φreason_template default %ToA_derived_red]:
‹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩I F T⇩1 one D f P⇩I
⟹ 𝗀𝗎𝖺𝗋𝖽 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[𝗌𝖺𝖿𝖾] one'' : one'
⟹ 𝗀𝗎𝖺𝗋𝖽 is_id_element one (NO_SIMP one'')
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ NO_SIMP (X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ T⇩1 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫)
⟹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f x ⦂ F one' 𝗐𝗂𝗍𝗁 P ∧ P⇩I x @tag 𝒯𝒫
<with-pattern> X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 var ⦂ F one' 𝗐𝗂𝗍𝗁 PP @tag 𝒯𝒫
<except-pattern> X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x'' ⦂ F (introduced one') 𝗐𝗂𝗍𝗁 PP @tag 𝒯𝒫 ›
unfolding Module_One⇩I_def NO_SIMP_def 𝗋Guard_def Premise_def Except_Pattern_def
Transformation_def With_Pattern_def Simplify_def is_id_element_def Action_Tag_def
by (simp; metis)
lemma [φreason_template default %ToA_derived_red]:
‹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩I F T⇩1 one D f P⇩I
⟹ 𝗀𝗎𝖺𝗋𝖽 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[𝗌𝖺𝖿𝖾] one'' : one'
⟹ 𝗀𝗎𝖺𝗋𝖽 is_id_element one (NO_SIMP one'')
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ NO_SIMP (X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ T⇩1 𝗋𝖾𝗆𝖺𝗂𝗇𝗌 R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫)
⟹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f x ⦂ F one' 𝗋𝖾𝗆𝖺𝗂𝗇𝗌 R 𝗐𝗂𝗍𝗁 P ∧ P⇩I x @tag 𝒯𝒫
<with-pattern> X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 var ⦂ F one' 𝗋𝖾𝗆𝖺𝗂𝗇𝗌 R 𝗐𝗂𝗍𝗁 PP @tag 𝒯𝒫
<except-pattern> X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x'' ⦂ F (introduced one') 𝗋𝖾𝗆𝖺𝗂𝗇𝗌 R 𝗐𝗂𝗍𝗁 PP @tag 𝒯𝒫 ›
unfolding Module_One⇩I_def NO_SIMP_def 𝗋Guard_def Premise_def Transformation_def
With_Pattern_def Except_Pattern_def is_id_element_def Simplify_def Action_Tag_def
by (clarsimp; metis)
lemma [φreason_template default %ToA_derived_red]:
‹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩I F T⇩1 one D f P⇩I
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D (fst x)
⟹ NO_MATCH (id one'') one @tag 𝒜_template_reason undefined
⟹ NO_SIMP (X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ T⇩1 ✼ R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫')
⟹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 apfst f x ⦂ F one ✼ R 𝗐𝗂𝗍𝗁 P ∧ P⇩I (fst x) @tag 𝒯𝒫'
<with-pattern> X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 var ⦂ F one ✼ RR 𝗐𝗂𝗍𝗁 PP @tag 𝒯𝒫' ›
unfolding Module_One⇩I_def NO_SIMP_def 𝗋Guard_def Premise_def Transformation_def
With_Pattern_def Action_Tag_def φProd'_def
by (cases x; clarsimp simp add: φProd_expn'; metis)
lemma [φreason_template default %ToA_derived_red]:
‹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩I F T⇩1 one D f P⇩I
⟹ (𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 one' : one) @tag 𝒜_template_reason undefined
⟹ NO_MATCH one one' @tag 𝒜_template_reason None
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D (fst x)
⟹ NO_SIMP (X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ T⇩1 ✼ R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫')
⟹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 apfst f x ⦂ F one' ✼ R 𝗐𝗂𝗍𝗁 P ∧ P⇩I (fst x) @tag 𝒯𝒫'
<with-pattern> X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 var ⦂ F one' ✼ RR 𝗐𝗂𝗍𝗁 PP @tag 𝒯𝒫' ›
unfolding Module_One⇩I_def NO_SIMP_def 𝗋Guard_def Premise_def Simplify_def Action_Tag_def
Transformation_def With_Pattern_def φProd'_def
by (cases x; clarsimp simp add: φProd_expn'; metis)
lemma [φreason_template default %derived_SE_red_scalar_one]:
‹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩I F T⇩1 one D f P⇩I
⟹ 𝗀𝗎𝖺𝗋𝖽 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[𝗌𝖺𝖿𝖾] one'' : one'
⟹ 𝗀𝗎𝖺𝗋𝖽 is_id_element one (NO_SIMP one'')
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D (fst x)
⟹ NO_SIMP (X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ T⇩1 ✼ R 𝗐𝗂𝗍𝗁 P) @tag 𝒯𝒫'
⟹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 apfst f x ⦂ F one' ✼ R 𝗐𝗂𝗍𝗁 P ∧ P⇩I (fst x) @tag 𝒯𝒫'
<with-pattern> X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 var ⦂ F one' ✼ RR 𝗐𝗂𝗍𝗁 PP @tag 𝒯𝒫'
<except-pattern> X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x'' ⦂ F (introduced one') ✼ RR 𝗐𝗂𝗍𝗁 PP @tag 𝒯𝒫' ›
unfolding Module_One⇩I_def NO_SIMP_def 𝗋Guard_def Premise_def Transformation_def φProd'_def
With_Pattern_def Except_Pattern_def Simplify_def is_id_element_def Action_Tag_def
by (cases x; clarsimp simp add: φProd_expn'; metis)
paragraph ‹Reasoning when having SDistr›
text ‹The difficulty of reasoning φ-type transformations lies in the two directions that
the transformations can follow, hierarchically swapping an inner φ-type out ‹F (G T) ⟶ G (F T)›
and horizontally over ‹*› including splitting and merging.
As an example example, the reasoning of transformation
‹x ⦂ F a T * others ⟶ y ⦂ F b U› with ‹a ≤ b› can reduce to 2 subgoals, ‹T ⟶ F (b/a) U› which looks
for the missed portion from the inner hierarchy of ‹T›, or ‹others ⟶ F (b-a) U› which looks
horizontally from the φ-types beside, or even any mixture of the two subgoals -- some portion from inner
and some portion beside.
To reduce the search space, we first normalize an assertion by swapping commutative φ-type operators
to move identical operators into the same level, so that the later reasoning only needs to consider
horizontal splitting and merging. To do so, we assign a weight to each φ-type such that two φ-types
are of an identical weight iff they are identical.
φ-Types of a higher weight will sink towards the leaves during the normalization,
so the normalization ensures ‹weight(F) ≤ weight(G)› for any normalized term ‹F (G T)› iff ‹F›
is commutative over ‹G› and ‹F,G› have a weight.
The weight can be annotated by users, to have a better control of the normalization,
or simplify by lexical order if not significant.
When identical φ-types are on the same level, the reasoning of the transformations
‹x ⦂ F a T ⟶ y ⦂ U› or ‹y ⦂ U ⟶ x ⦂ F a T› where a semimodule φ-type is given in one side but
missed in the opposite side, can decide whether to embed the opposite φ-type
‹U› into a semimodule ‹F 1 U› of identity scalar, by checking whether the weight of ‹U› is greater than
the weight of ‹F a T›, which implies no swappable semimodule ‹F› that can move here can be seen in ‹U›.
If we denote ‹F > G ≜ weight(F) > weight(G) ∧ commutative(F,G)›, the normalization ensures in
a given syntactic tree of φ-type operators, any path from the root to a leaf φ-type is non-descending,
i.e., ‹¬ (F > G)› for any adjacent ‹F, G›, i.e., ‹F› is not heavier than ‹G› if ‹commutative(F,G)›.
A problem is whether all syntactic tree of φ-type operators can be uniquely normalized.
*: The check of ‹F > G› is carried by LP reasoner ‹Require_Weight_Norm› in the code.
For the sake of unique normalization, we require all commutativity between the φ-type operators is transitive.
We designate ‹commutative(F,G)› to mean ‹F› can be swapped into ‹G›, ‹∃f. x ⦂ F (G T) ⟶ f(x) ⦂ G (F T)›,
but not necessarily reversely.
The transitivity means ‹commutative(F⇩1,F⇩2) ∧ commutative(F⇩2,F⇩3) ⟶ commutative(F⇩1,F⇩3)›.
If we draw a directed edge from ‹F› to ‹G› to mean ‹weight(F) < weight(G)› and ‹F› can be swapped with ‹G›
by any steps of swapping adjacent operators in the sequence (another name of the path).
The transitivity ensures any given sequence generates a disjoint union of several fully connected
directed acyclic graph.
Therefore, for any given sequence, we only need to swap any occurrences of ‹F, G› where ‹F > G› (a bubbling sort),
and any order of swapping results in the unique normalized form, which is the topological sorting
of the generated graph with connected components in the order of their occurrences in the sequence.
Therefore, a path can be uniquely normalized.
Another issue is many paths exist in the tree. We can normalize the paths one by one in any order.
An operator ‹F› can be of multi-arity, so multiple children. Assume one path of the operand ‹G⇩i› is
normalized, when the normalization of another operand ‹G⇩j› swaps ‹G⇩j› out of ‹F›, ‹G⇩j› is inserted
into the normalized path of ‹G⇩i›, changing it from ‹Root … F G⇩i … Leaf› to ‹Root … G⇩j F G⇩i … Leaf›.
The sub-sequence ‹G⇩i … Leaf› is unchanged but the property of ‹Root … G⇩j F› is temporarily broken.
However, with the normalization of the path ‹G⇩j›, ‹Root … G⇩j F› will be normalized, and the concatenation
of the normalized ‹Root … G⇩j F› with ‹G⇩i … Leaf› also yields a normalized path, because ‹¬ (G⇩i > F)›.
Besides, not all multi-arity operator pair ‹(F,G)› has partial commutativity (in sense of fixing
all of its operands except one, ‹F (fixed, G(T)) ⟶ G (F (fixed, T))›, so reducing the notion of
multi-arity commutativity to the normal commutativity of single-arity type operators),
but total commutativity where all operands are of the same φ-type and swapped together,
e.g., ‹F (G(T), G(U)) ⟶ G (F (T, U))› and ‹F=(∗), G=((❙→) k)› is an instance.
It brings no problem to the normalization, because it is swapping ‹F› and ‹G› simultaneously in
the paths of all its operands, and this swapping is valid in either of the paths in our bubbling sort
algorithm.
At last, not all operators need normalization. Operators like ‹∗, +, ∧, Σ› are already handled well
by the reasoner, so they can occur anywhere in the tree and there is no need to move them onto certain same level.
We do not assign a weight to them so they do not have any weight relation with others.
It optimizes the normalization performance.
›
subparagraph ‹Preliminary›
consts restore_from_semimodule :: ‹bool ⇒ ('s ⇒ ('e, 'd) φ) ⇒ action›
declare [[ φreason_default_pattern
‹_ ⦂ _ 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 _ ⦂ ?U 𝗐𝗂𝗍𝗁 _ @tag restore_from_semimodule True ?F› ⇒
‹_ ⦂ _ 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 _ ⦂ ?U 𝗐𝗂𝗍𝗁 _ @tag restore_from_semimodule True ?F› (100)
and ‹_ ⦂ ?T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 _ ⦂ _ 𝗐𝗂𝗍𝗁 _ @tag restore_from_semimodule False ?F› ⇒
‹_ ⦂ ?T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 _ ⦂ _ 𝗐𝗂𝗍𝗁 _ @tag restore_from_semimodule False ?F› (100)
]]
φreasoner_group restore_from_semimodule = (1000, [1000,1001]) for ‹_ @tag restore_from_semimodule _ _›
‹The reasoning later lifts a φ-type in to a semimodule with scalar one. The lifted semimodule
not always succeeds, and may return with no change. If so, the reasoning process here, restore the
lifted semimodule back to the original φ-type, by unwrapping the scalar one. ›
lemma [φreason %restore_from_semimodule+1]:
‹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩I F T⇩1 one D f P⇩I
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ T⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f x ⦂ F (introduced one) @tag restore_from_semimodule True F ›
unfolding Module_One⇩I_def Action_Tag_def Transformation_def Premise_def 𝗋Guard_def
by simp
lemma [φreason %restore_from_semimodule+1]:
‹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩E F T⇩1 one D f P⇩E
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ F (introduced one) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f x ⦂ T⇩1 @tag restore_from_semimodule False F ›
unfolding Module_One⇩E_def Action_Tag_def Transformation_def Premise_def 𝗋Guard_def
by simp
lemma [φreason %restore_from_semimodule for ‹_ 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 _ @tag restore_from_semimodule _ _›]:
‹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 X @tag restore_from_semimodule Any F ›
unfolding Action_Tag_def
by simp
subparagraph ‹Main›
lemma [φreason_template default %derived_SE_inj_to_module name F.wrap_module_src]:
‹ 𝗀𝗎𝖺𝗋𝖽 partial_add_overlaps one b
⟹ 𝗀𝗎𝖺𝗋𝖽 Not_Require_SA_Norm (F one) True
⟹ 𝗀𝗎𝖺𝗋𝖽 Type_Variant_of_the_Same_Scalar_Mul⇩0 F F'
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩I F T⇩1 one D f P⇩I
⟹ NO_SIMP (apfst f x ⦂ F (introduced one) ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F' b ✼ R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫')
⟹ NO_SIMP (snd x ⦂ W' 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 snd x ⦂ W @tag restore_from_semimodule True F)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D (fst x)
⟹ x ⦂ T⇩1 ✼ W' 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F' b ✼ R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫'
<except-pattern> xx ⦂ F aa ✼ W' 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F' b ✼ R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫' ›
unfolding Module_One⇩I_def Transformation_def Premise_def 𝗋Guard_def
Action_Tag_def NO_SIMP_def Except_Pattern_def φProd'_def
by (clarsimp; metis)
lemma [φreason_template default %derived_SE_inj_to_module+1 name F.wrap_module_tgt]:
‹ 𝗀𝗎𝖺𝗋𝖽 partial_add_overlaps a one
⟹ 𝗀𝗎𝖺𝗋𝖽 Not_Require_SA_Norm (F one) False
⟹ 𝗀𝗎𝖺𝗋𝖽 Type_Variant_of_the_Same_Scalar_Mul⇩0 F' F
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩E F T⇩1 one D f P⇩E
⟹ NO_SIMP (y ⦂ F' a ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ F (introduced one) ✼ R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫')
⟹ NO_SIMP (snd x ⦂ R 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 r ⦂ R' @tag restore_from_semimodule False F)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D (fst x)
⟹ y ⦂ F' a ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 (f (fst x), r) ⦂ T⇩1 ✼ R' 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫'
<except-pattern> y ⦂ F' a ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 xx ⦂ F bb ✼ R' 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫' ›
unfolding Module_One⇩E_def Transformation_def Premise_def 𝗋Guard_def
Action_Tag_def NO_SIMP_def Except_Pattern_def φProd'_def
by (clarsimp; blast)
lemma ToA_mapper_MOne_src
[no_atp, φreason_template default %φmapToA_derived_module_wrapper name F.mapper_wrap_module_src]:
‹ 𝗀𝗎𝖺𝗋𝖽 partial_add_overlaps a one
⟹ 𝗀𝗎𝖺𝗋𝖽 partial_add_overlaps b one'
⟹ 𝗀𝗎𝖺𝗋𝖽 Not_Require_SA_Norm (F one) True
⟹ 𝗀𝗎𝖺𝗋𝖽 Not_Require_SA_Norm (F one') True
⟹ 𝗀𝗎𝖺𝗋𝖽 Type_Variant_of_the_Same_Scalar_Mul⇩0 F' F
⟹ 𝗀𝗎𝖺𝗋𝖽 Type_Variant_of_the_Same_Scalar_Mul⇩0 F' G
⟹ 𝗀𝗎𝖺𝗋𝖽 Type_Variant_of_the_Same_Scalar_Mul⇩0 F' G'
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩I F T⇩1 one D⇩I I⇩1 P⇩I
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩E G U⇩1 one' D⇩E E⇩1 P⇩E
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀x∈fst ` D. D⇩I x ∧ D⇩E (f (I⇩1 x)))
⟹ 𝗆𝖺𝗉 g ⊗⇩f r : F' a ✼ R ↦ G' b ✼ R
𝗈𝗏𝖾𝗋 f ⊗⇩f w : F (introduced one) ✼ W ↦ G (introduced one') ✼ W
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s 𝗂𝗇 apfst I⇩1 ` D
⟹ 𝗆𝖺𝗉 g ⊗⇩f r : F' a ✼ R ↦ G' b ✼ R
𝗈𝗏𝖾𝗋 (E⇩1 o f o I⇩1) ⊗⇩f w : T⇩1 ✼ W ↦ U⇩1 ✼ W
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h o apfst I⇩1 𝗌𝖾𝗍𝗍𝖾𝗋 apfst E⇩1 o s 𝗂𝗇 D ›
unfolding 𝗋Guard_def φProd'_def
apply (simp add: φProd_expn'' φProd_expn' φSome_φProd[symmetric])
❴ premises _ and _ and _ and _ and _ and _ and _ and S1I[] and S1E[] and _ and Tr[]
apply_rule apply_Module_One⇩I[OF S1I]
apply_rule ToA_Mapper_onward[OF Tr, where x=‹apfst I⇩1 x›]
❵ apply(rule conjunctionI, rule)
❴ premises _ and _ and _ and _ and _ and _ and _ and S1I[] and S1E[] and _ and Tr[]
apply_rule ToA_Mapper_backward[OF Tr] certified by (instantiate ‹x›; auto_sledgehammer) ;
apply_rule apply_Module_One⇩E[OF S1E]
certified by (insert ToA_Mapper_f_expn[OF Tr], auto_sledgehammer) ;;
❵ by (rule conjunctionI, rule, drule ToA_Mapper_f_expn_rev, clarsimp)
lemma ToA_mapper_MOne_tgt
[no_atp, φreason_template default %φmapToA_derived_module_wrapper+1 name F.mapper_wrap_module_tgt]:
‹ 𝗀𝗎𝖺𝗋𝖽 partial_add_overlaps a one
⟹ 𝗀𝗎𝖺𝗋𝖽 partial_add_overlaps b one'
⟹ 𝗀𝗎𝖺𝗋𝖽 Not_Require_SA_Norm (F one) False
⟹ 𝗀𝗎𝖺𝗋𝖽 Not_Require_SA_Norm (G one') False
⟹ 𝗀𝗎𝖺𝗋𝖽 Type_Variant_of_the_Same_Scalar_Mul⇩0 F' F
⟹ 𝗀𝗎𝖺𝗋𝖽 Type_Variant_of_the_Same_Scalar_Mul⇩0 F' G
⟹ 𝗀𝗎𝖺𝗋𝖽 Type_Variant_of_the_Same_Scalar_Mul⇩0 F' G'
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩I G U⇩1 one' D⇩I E⇩1 P⇩I
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩E F T⇩1 one D⇩E I⇩1 P⇩E
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀x∈D. D⇩E (fst (h x)) ∧ D⇩I (g (I⇩1 (fst (h x)))))
⟹ 𝗆𝖺𝗉 (E⇩1 o g o I⇩1) ⊗⇩f r : F (introduced one) ✼ R ↦ G (introduced one') ✼ R
𝗈𝗏𝖾𝗋 f ⊗⇩f w : F' a ✼ W ↦ G' b ✼ W
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s 𝗂𝗇 D
⟹ 𝗆𝖺𝗉 g ⊗⇩f r : T⇩1 ✼ R ↦ U⇩1 ✼ R
𝗈𝗏𝖾𝗋 f ⊗⇩f w : F' a ✼ W ↦ G' b ✼ W
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 apfst I⇩1 o h 𝗌𝖾𝗍𝗍𝖾𝗋 s o apfst E⇩1 𝗂𝗇 D ›
for F :: ‹'a::plus ⇒ 'b ⇒ 'c::sep_magma_1 BI›
and T⇩1 :: ‹'b2 ⇒ 'c BI›
unfolding 𝗋Guard_def φProd'_def
apply (simp add: φProd_expn'' φProd_expn' φSome_φProd[symmetric])
❴ premises _ and _ and _ and _ and _ and _ and _ and S1I[] and S1E[] and _ and Tr[]
apply_rule ToA_Mapper_onward[OF Tr, where x=‹x›]
apply_rule apply_Module_One⇩E[OF S1E]
❵ apply(rule conjunctionI, rule)
❴ premises _ and _ and _ and _ and _ and _ and _ and S1I[] and S1E[] and _ and Tr[]
apply_rule apply_Module_One⇩I[OF S1I]
certified by auto_sledgehammer ;
apply_rule ToA_Mapper_backward[OF Tr, where x=‹apfst E⇩1 x›]
certified by (insert ToA_Mapper_f_expn[OF Tr] useful; auto simp add: fun_eq_iff map_prod_def image_iff;
smt (verit, best) Pair_inject apfst_convE case_prod_conv) ;;
❵ by(rule conjunctionI, rule, drule ToA_Mapper_f_expn_rev, clarsimp simp: Premise_def prod.map_beta)
subsubsection ‹Associativity›
lemma scalar_assoc_template[φreason_template name Fc.scalar_assoc [assertion_simps]]:
‹ Module_Assoc⇩I Fs Ft Fc T Ds Dt (λ_ _ _. True) smul (λ_ _ x. x)
⟹ Module_Assoc⇩E Fs Ft Fc T Ds Dt (λ_ _ _. True) smul (λ_ _ x. x)
⟹ Ds s ∧ Dt t
⟹ Fs s (Ft t T) = Fc (smul s t) T ›
unfolding Module_Assoc⇩E_def Module_Assoc⇩I_def
by (rule φType_eqI_Tr; simp)
lemma [φreason_template name Fc.scalar_functor [no_atp]]:
‹ Module_Assoc⇩I Fs' Ft' Fc' U Ds' Dt' Dx' smul' f'
⟹ Module_Assoc⇩E Fs Ft Fc T Ds Dt Dx smul f
⟹ Functional_Transformation_Functor (Fs s) (Fs' s') (Ft t T) (Ft' t' U) D R pm fm
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 Ds s ∧ Dt t ∧ Ds' s' ∧ Dt' t' ∧ Dx s t x ∧
Dx' s' t' (fm g P (f s t x)) ∧ (∀ a ∈ D (f s t x). g a ∈ R (f s t x))
⟹ (⋀a ∈ D (f s t x). a ⦂ Ft t T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 g a ⦂ Ft' t' U 𝗐𝗂𝗍𝗁 P a @tag 𝒯𝒫 )
⟹ x ⦂ Fc (smul s t) T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f' s' t' (fm g P (f s t x)) ⦂ Fc' (smul' s' t') U 𝗐𝗂𝗍𝗁 pm g P (f s t x) @tag 𝒯𝒫 ›
unfolding Module_Assoc⇩I_def Module_Assoc⇩E_def
Transformation_def Premise_def Functional_Transformation_Functor_def
meta_Ball_def Action_Tag_def
by clarsimp metis
lemma template_scalar_partial_functor[φreason_template name Fc.scalar_partial_functor [no_atp]]:
‹ Module_Assoc⇩I Fs' Ft' Fc' U Ds' Dt' Dx' smul' f'
⟹ Module_Assoc⇩E Fs Ft Fc T Ds Dt Dx smul f
⟹ Separation_Homo⇩I_Cond (Fs s) F⇩W F⇩s⇩W C⇩W (Ft t T) W Dz z
⟹ Separation_Homo⇩E_Cond (Fs' s') F⇩R F⇩s⇩R C⇩R (Ft' t' U) R Du uz
⟹ Functional_Transformation_Functor F⇩s⇩W F⇩s⇩R (Ft t T ∗ ◒[C⇩W] W) (Ft' t' U ∗ ◒[C⇩R] R) D Rng pm fm
⟹ (⋀a ∈ D (z (apfst (f s t) x)).
a ⦂ Ft t T ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 g a ⦂ Ft' t' U ✼ R 𝗐𝗂𝗍𝗁 P a @tag 𝒯𝒫' )
⟹ SE_Has_or_Not C⇩W W F⇩W FW
⟹ SE_Has_or_Not C⇩R R F⇩R FR
⟹ 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[𝗌𝖺𝖿𝖾] (prem, ff, PP) : (
Dx' s' t' (fst (uz (fm g P (z (apfst (f s t) x))))) ∧ (apfst (f s t) x) ∈ Dz ∧
(∀a ∈ D (z (apfst (f s t) x)). g a ∈ Rng (z (apfst (f s t) x))) ∧
(fm g P (z (apfst (f s t) x))) ∈ Du,
apfst (f' s' t') (uz (fm g P (z (apfst (f s t) x)))),
pm g P (z (apfst (f s t) x)))
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 Ds s ∧ Dt t ∧ Ds' s' ∧ Dt' t' ∧ Dx s t (fst x) ∧ prem
⟹ x ⦂ Fc (smul s t) T ✼ FW 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 ff ⦂ Fc' (smul' s' t') U ✼ FR 𝗐𝗂𝗍𝗁 PP @tag 𝒯𝒫' ›
unfolding Action_Tag_def φProd'_def SE_Has_or_Not_alt_def
❴ premises SA⇩I[] and SA⇩E[] and SH⇩I[] and SH⇩E[] and FTF[] and Tr[] and [simp] and [simp]
apply_rule transformation_right_frame_ty[OF apply_Semimodule_SAssoc⇩E[OF SA⇩E]]
apply_rule apply_Separation_Homo⇩I_Cond[OF SH⇩I, simplified]
apply_rule apply_Functional_Transformation_Functor[OF FTF, where P=P, simplified]
❴ Tr ❵
apply_rule apply_Separation_Homo⇩E_Cond[OF SH⇩E, simplified]
apply_rule transformation_right_frame_ty[OF apply_Semimodule_SAssoc⇩I[OF SA⇩I]]
❵ .
lemma [φreason_template default %ToA_derived_red]:
‹ 𝗀𝗎𝖺𝗋𝖽 Require_Assoc_Norm (Fs s (Ft t T)) True
⟹ Module_Assoc⇩I Fs Ft Fc T Ds Dt Dx smul f
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ds s ∧ Dt t ∧ Dx s t x
⟹ NO_SIMP (f s t x ⦂ Fc (smul s t) T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫)
⟹ NO_SIMP (x ⦂ Fs s (Ft t T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫) ›
unfolding NO_SIMP_def Module_Assoc⇩I_def 𝗋Guard_def Premise_def Action_Tag_def
using mk_elim_transformation by blast
lemma [φreason_template default %ToA_derived_red]:
‹ 𝗀𝗎𝖺𝗋𝖽 Require_Assoc_Norm (Fs s (Ft t T)) True
⟹ Module_Assoc⇩I Fs Ft Fc T Ds Dt Dx smul f
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ds s ∧ Dt t ∧ Dx s t x
⟹ NO_SIMP (R * (f s t x ⦂ Fc (smul s t) T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫)
⟹ NO_SIMP (R * (x ⦂ Fs s (Ft t T)) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫) ›
unfolding Module_Assoc⇩I_def Premise_def NO_SIMP_def 𝗋Guard_def Action_Tag_def
using transformation_left_frame mk_elim_transformation by blast
lemma [φreason_template default %ToA_derived_red]:
‹ 𝗀𝗎𝖺𝗋𝖽 Require_Assoc_Norm (Fs s (Ft t T)) False
⟹ Module_Assoc⇩E Fs Ft Fc T Ds Dt Dx smul f
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ds s ∧ Dt t ∧ Dx s t x
⟹ NO_SIMP (X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ Fc (smul s t) T 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫)
⟹ NO_SIMP (X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f s t x ⦂ Fs s (Ft t T) 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫) ›
unfolding Module_Assoc⇩E_def Premise_def NO_SIMP_def 𝗋Guard_def Action_Tag_def
using mk_intro_transformation by blast
lemma [φreason_template default %ToA_derived_red]:
‹ 𝗀𝗎𝖺𝗋𝖽 Require_Assoc_Norm (Fs s (Ft t T)) False
⟹ Module_Assoc⇩E Fs Ft Fc T Ds Dt Dx smul f
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ds s ∧ Dt t ∧ Dx s t x
⟹ NO_SIMP (X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ Fc (smul s t) T 𝗋𝖾𝗆𝖺𝗂𝗇𝗌 R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫)
⟹ NO_SIMP (X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f s t x ⦂ Fs s (Ft t T) 𝗋𝖾𝗆𝖺𝗂𝗇𝗌 R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫) ›
unfolding Module_Assoc⇩E_def Premise_def NO_SIMP_def 𝗋Guard_def Action_Tag_def REMAINS_def
using transformation_right_frame mk_intro_transformation by blast
lemma [φreason_template %To_ToA_derived_SAssoc]:
‹ Module_Assoc⇩E Fs Ft Fc T Ds Dt Dx smul f
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ds s ∧ Dt t ∧ Dx s t x
⟹ x ⦂ Fc (smul s t) T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fs s (Ft t T) 𝗌𝗎𝖻𝗃 y. y = f s t x @tag to (𝗌𝗉𝗅𝗂𝗍-𝖺𝗌𝗌𝗈𝖼 s t) ›
unfolding Module_Assoc⇩E_def Premise_def 𝗋Guard_def Action_Tag_def
by simp
paragraph ‹ToA-based Simplification›
lemma [φreason_template [φtransformation_based_backward_simp default %To_ToA_derived_SAssoc no trigger]]:
‹ Module_Assoc⇩E Fs Ft Fc T Ds Dt Dx smul f
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ds s ∧ Dt t ∧ Dx s t x
⟹ x ⦂ Fc (smul s t) T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fs s (Ft t T) 𝗌𝗎𝖻𝗃 y. y = f s t x @tag 𝒜backward_simp ›
unfolding Module_Assoc⇩E_def Premise_def 𝗋Guard_def Action_Tag_def
by simp
lemma [φreason_template [φtransformation_based_simp default %To_ToA_derived_SAssoc no trigger]]:
‹ Module_Assoc⇩I Fs Ft Fc T Ds Dt Dx smul f
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ds s ∧ Dt t ∧ Dx s t x
⟹ x ⦂ Fs s (Ft t T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Fc (smul s t) T 𝗌𝗎𝖻𝗃 y. y = f s t x @tag 𝒜simp ›
unfolding Module_Assoc⇩I_def Premise_def 𝗋Guard_def Action_Tag_def
by simp
subsubsection ‹Scalar Distributivity›
lemma [φreason_template name F.unfold_sdistr[]]:
‹ Module_Distr_Homo⇩S F Ds Du uz
⟹ Module_Distr_Homo⇩Z F Ds Dz zi
⟹ Ds s ∧ Ds t ∧ s ##⇩+ t ∧ Du s t x ∧ Dz s t (uz s t x) ∧
zi s t (uz s t x) = x
⟹ (x ⦂ F (s + t)) = (uz s t x ⦂ F s ∗ F t) ›
unfolding Module_Distr_Homo⇩Z_def Module_Distr_Homo⇩S_def
by (rule assertion_eq_intro; clarsimp simp del: split_paired_All; metis)
paragraph ‹Checking of Non-SDistr›
lemma [φreason_template 0]:
‹ Semimodule_No_SDistr F
⟹ Module_Distr_Homo⇩S F Ds Du uz
⟹ ERROR TEXT(F ‹is declared as non-scalar-associative but a property is given›
(Module_Distr_Homo⇩S F Ds Du uz)) @tag 𝒜_template_reason undefined
⟹ True›
..
lemma [φreason_template 0]:
‹ Semimodule_No_SDistr F
⟹ Module_Distr_Homo⇩Z F Ds Du uz
⟹ ERROR TEXT(F ‹is declared as non-scalar-associative but a property is given›
(Module_Distr_Homo⇩Z F Ds Du uz)) @tag 𝒜_template_reason undefined
⟹ True›
..
paragraph ‹Zip›
lemma SDirst_in_comm_scalar_implies_rev⇩Z
[φadding_property = false,
φreason default %φTA_fallback_lattice,
φadding_property = true]:
‹ Module_Distr_Homo⇩Z F Ds Dx z
⟹ Module_Distr_Homo⇩Z_rev F Ds Dx z Dx z›
for F :: ‹('s::partial_ab_semigroup_add ⇒ ('c::sep_magma,'a) φ)›
unfolding Module_Distr_Homo⇩Z_rev_def Module_Distr_Homo⇩Z_def
by (simp add: dom_of_add_commute partial_add_commute)
lemma SDirst_in_comm_sep_implies_rev⇩Z
[φadding_property = false,
φreason default %φTA_fallback_lattice-1,
φadding_property = true]:
‹ Module_Distr_Homo⇩Z F Ds Dx z
⟹ Module_Distr_Homo⇩Z_rev F Ds Dx z (λs t. Dx t s o prod.swap) (λs t. z t s o prod.swap)›
for F :: ‹('s::partial_add_magma ⇒ ('c::sep_ab_semigroup,'a) φ)›
unfolding Module_Distr_Homo⇩Z_rev_def Module_Distr_Homo⇩Z_def
by (simp add: φProd_expn'; metis mult.commute)
paragraph ‹Unzip›
lemma SDirst_in_comm_scalar_implies_rev⇩U
[φadding_property = false,
φreason default %φTA_fallback_lattice,
φadding_property = true]:
‹ Module_Distr_Homo⇩S F Ds Dx uz
⟹ Module_Distr_Homo⇩S_rev F Dx uz Ds Dx uz›
for F :: ‹('s::partial_ab_semigroup_add ⇒ ('c::sep_magma,'a) φ)›
unfolding Module_Distr_Homo⇩S_rev_def Module_Distr_Homo⇩S_def
by (simp add: dom_of_add_commute partial_add_commute)
lemma SDirst_in_comm_sep_implies_rev⇩U
[φadding_property = false,
φreason default %φTA_fallback_lattice-1,
φadding_property = true]:
‹ Module_Distr_Homo⇩S F Ds Dx z
⟹ Module_Distr_Homo⇩S_rev F Dx uz Ds (λs t. Dx t s) (λs t. prod.swap o z t s)›
for F :: ‹('s::partial_add_magma ⇒ ('c::sep_ab_semigroup,'a) φ)›
unfolding Module_Distr_Homo⇩S_rev_def Module_Distr_Homo⇩S_def
by (clarsimp simp add: φProd_expn'' mult.commute)
lemma [φreason_template %To_ToA_derived_SDistri]:
‹ Module_Distr_Homo⇩S F Ds Dx uz
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 Ds s ∧ Ds t ∧ s ##⇩+ t ∧ Dx s t x
⟹ x ⦂ F (s + t) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F s ∗ F t 𝗌𝗎𝖻𝗃 y. y = uz s t x @tag to (𝗌𝗉𝗅𝗂𝗍-𝗌𝖼𝖺𝗅𝖺𝗋 s t) ›
unfolding Module_Distr_Homo⇩S_def Premise_def Action_Tag_def
by simp
subsection ‹Separation Extraction›
subsubsection ‹Transformation Functors›
paragraph ‹Transformation Functor›
lemma [φreason_template default %derived_SE_functor name F⇩1.separation_extraction]:
‹ 𝗀𝗎𝖺𝗋𝖽 Functional_Transformation_Functor F⇩1⇩4 F⇩2⇩3 (T ∗ ◒[Cw] W) (U ∗ ◒[Cr] R) Dom Rng pred_mapper func_mapper
⟹ 𝗀𝗎𝖺𝗋𝖽 Separation_Homo⇩I_Cond F⇩1 F⇩4 F⇩1⇩4 Cw T W Dz z
⟹ 𝗀𝗎𝖺𝗋𝖽 Separation_Homo⇩E_Cond F⇩3 F⇩2 F⇩2⇩3 Cr U R Du uz
⟹ (⋀a ∈ Dom (z x).
a ⦂ T ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f a ⦂ U ✼ R 𝗐𝗂𝗍𝗁 P a @tag 𝒯𝒫' )
⟹ SE_Has_or_Not Cw W F⇩4 FW
⟹ SE_Has_or_Not Cr R F⇩2 FR
⟹ 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[𝗌𝖺𝖿𝖾] (y, prem, PP) :
(uz (func_mapper f P (z x)),
(y = uz (func_mapper f P (z x)) ⟶
x ∈ Dz ∧ (∀a. a ∈ Dom (z x) ⟶ f a ∈ Rng (z x))
∧ func_mapper f P (z x) ∈ Du),
pred_mapper f P (z x))
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 prem
⟹ x ⦂ F⇩1 T ✼ FW 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F⇩3 U ✼ FR 𝗐𝗂𝗍𝗁 PP @tag 𝒯𝒫' ›
unfolding 𝗋Guard_def SE_Has_or_Not_alt_def φProd'_def
❴ premises FTF[] and SH⇩I[] and SH⇩E[] and Tr and [simp] and [simp]
apply_rule apply_Separation_Homo⇩I_Cond[where Fu=F⇩4 and Ft=F⇩1, OF SH⇩I, simplified]
apply_rule apply_Functional_Transformation_Functor[where f=f and P=P, OF FTF, simplified]
❴ Tr ❵ ;
apply_rule apply_Separation_Homo⇩E_Cond[OF SH⇩E, simplified]
❵ .
subparagraph ‹With Parameterization›
lemma ""[φreason_template default %derived_SE_functor]:
‹ 𝗀𝗎𝖺𝗋𝖽 Functional_Transformation_Functor⇩Λ F⇩1⇩4 F⇩2⇩3 (λp. T p ∗ ◒[Cw] W p) (λp. U p ∗ ◒[Cr] R p) Dom Rng pred_mapper func_mapper
⟹ 𝗀𝗎𝖺𝗋𝖽 Separation_Homo⇩Λ⇩I_Cond F⇩1 F⇩4 F⇩1⇩4 Cw T W Dz z
⟹ 𝗀𝗎𝖺𝗋𝖽 Separation_Homo⇩Λ⇩E_Cond F⇩3 F⇩2 F⇩2⇩3 Cr U R Du uz
⟹ (⋀p. ⋀a ∈ Dom p (z x).
a ⦂ T p ✼ W p 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f p a ⦂ U p ✼ R p 𝗐𝗂𝗍𝗁 P p a @tag 𝒯𝒫' )
⟹ SE_Has_or_Not⇩Λ Cw W F⇩4 FW
⟹ SE_Has_or_Not⇩Λ Cr R F⇩2 FR
⟹ 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 (y, prem, PP) :
(uz (func_mapper f P (z x)),
(y = uz (func_mapper f P (z x)) ⟶
x ∈ Dz ∧ (∀p a. a ∈ Dom p (z x) ⟶ f p a ∈ Rng p (z x))
∧ func_mapper f P (z x) ∈ Du),
pred_mapper f P (z x))
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 prem
⟹ x ⦂ F⇩1 T ✼ FW 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F⇩3 U ✼ FR 𝗐𝗂𝗍𝗁 PP @tag 𝒯𝒫' ›
unfolding 𝗋Guard_def SE_Has_or_Not⇩Λ_alt_def φProd'_def
apply simp
❴ premises FTF[] and SH⇩I[] and SH⇩E[] and Tr and [simp] and [simp]
apply_rule apply_Separation_Homo⇩Λ⇩I_Cond[where Fu=F⇩4 and Ft=F⇩1, OF SH⇩I, simplified]
apply_rule apply_Functional_Transformation_Functor⇩Λ[where f=f and P=P, OF FTF, simplified]
❴ Tr ❵
apply_rule apply_Separation_Homo⇩Λ⇩E_Cond[OF SH⇩E, simplified]
❵ .
paragraph ‹Bi-Functor›
lemma [φreason_template default %derived_SE_functor name F⇩1.separation_extraction]:
‹ 𝗀𝗎𝖺𝗋𝖽 Functional_Transformation_BiFunctor F⇩1⇩4 F⇩2⇩3
(T⇩1 ∗ ◒[Cw] W⇩1) (T⇩2 ∗ ◒[Cw] W⇩2) (U⇩1 ∗ ◒[Cr] R⇩1) (U⇩2 ∗ ◒[Cr] R⇩2)
Dom1 Dom2 Rng1 Rng2 pred_mapper func_mapper
⟹ 𝗀𝗎𝖺𝗋𝖽 Separation_Homo⇩I⇩2_Cond F⇩1 F⇩4 F⇩1⇩4 Cw T⇩1 T⇩2 W⇩1 W⇩2 Dz z
⟹ 𝗀𝗎𝖺𝗋𝖽 Separation_Homo⇩E⇩2_Cond F⇩3 F⇩2 F⇩2⇩3 Cr U⇩1 U⇩2 R⇩1 R⇩2 Du uz
⟹ (⋀a ∈ Dom1 (z x). a ⦂ T⇩1 ✼ W⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f⇩1 a ⦂ U⇩1 ✼ R⇩1 𝗐𝗂𝗍𝗁 P⇩1 a @tag 𝒯𝒫' )
⟹ (⋀a ∈ Dom2 (z x). a ⦂ T⇩2 ✼ W⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f⇩2 a ⦂ U⇩2 ✼ R⇩2 𝗐𝗂𝗍𝗁 P⇩2 a @tag 𝒯𝒫' )
⟹ SE_Has_or_Not⇩2 Cw W⇩1 W⇩2 F⇩4 FW
⟹ SE_Has_or_Not⇩2 Cr R⇩1 R⇩2 F⇩2 FR
⟹ 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[𝗌𝖺𝖿𝖾] (y, prem, PP) :
(uz (func_mapper f⇩1 f⇩2 P⇩1 P⇩2 (z x)),
(y = uz (func_mapper f⇩1 f⇩2 P⇩1 P⇩2 (z x)) ⟶
x ∈ Dz
∧ (∀a. a ∈ Dom1 (z x) ⟶ f⇩1 a ∈ Rng1 (z x))
∧ (∀a. a ∈ Dom2 (z x) ⟶ f⇩2 a ∈ Rng2 (z x))
∧ func_mapper f⇩1 f⇩2 P⇩1 P⇩2 (z x) ∈ Du),
pred_mapper f⇩1 f⇩2 P⇩1 P⇩2 (z x))
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 prem
⟹ x ⦂ F⇩1 T⇩1 T⇩2 ✼ FW 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F⇩3 U⇩1 U⇩2 ✼ FR 𝗐𝗂𝗍𝗁 PP @tag 𝒯𝒫' ›
unfolding 𝗋Guard_def SE_Has_or_Not⇩2_alt_def φProd'_def
❴ premises FTF[] and SH⇩I[] and SH⇩E[] and Tr1 and Tr2 and [simp] and [simp]
apply_rule apply_Separation_Homo⇩I⇩2_Cond[where Fu=F⇩4 and Ft=F⇩1, OF SH⇩I, simplified]
apply_rule apply_Functional_Transformation_BiFunctor[where P⇩1=P⇩1 and P⇩2=P⇩2, OF FTF, simplified]
❴ Tr1 ❵
❴ Tr2 ❵
apply_rule apply_Separation_Homo⇩E⇩2_Cond[OF SH⇩E, simplified]
❵ .
paragraph ‹CV-Functor›
lemma [φreason_template default %derived_SE_functor name F⇩1.separation_extraction]:
‹ 𝗀𝗎𝖺𝗋𝖽 Fun_CV_TrFunctor F⇩1⇩4 F⇩2⇩3
(T⇩1 ∗ ◒[Cw] W⇩1) (T⇩2 ∗ ◒[Cw] W⇩2) (U⇩1 ∗ ◒[Cr] R⇩1) (U⇩2 ∗ ◒[Cr] R⇩2)
Dom1 Dom2 FC⇩1 Rng2 pred_mapper func_mapper
⟹ 𝗀𝗎𝖺𝗋𝖽 Separation_Homo⇩I⇩2_Cond F⇩1 F⇩4 F⇩1⇩4 Cw T⇩1 T⇩2 W⇩1 W⇩2 Dz z
⟹ 𝗀𝗎𝖺𝗋𝖽 Separation_Homo⇩E⇩2_Cond F⇩3 F⇩2 F⇩2⇩3 Cr U⇩1 U⇩2 R⇩1 R⇩2 Du uz
⟹ (⋀a. 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 f⇩1 a ∈ Dom1 (z x)
⟹ a ⦂ U⇩1 ✼ R⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f⇩1 a ⦂ T⇩1 ✼ W⇩1 𝗐𝗂𝗍𝗁 P⇩1 a @tag 𝒯𝒫' )
⟹ (⋀a ∈ Dom2 (z x). a ⦂ T⇩2 ✼ W⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f⇩2 a ⦂ U⇩2 ✼ R⇩2 𝗐𝗂𝗍𝗁 P⇩2 a @tag 𝒯𝒫' )
⟹ SE_Has_or_Not⇩2 Cw W⇩1 W⇩2 F⇩4 FW
⟹ SE_Has_or_Not⇩2 Cr R⇩1 R⇩2 F⇩2 FR
⟹ 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[𝗌𝖺𝖿𝖾] (y, prem, PP) :
(uz (func_mapper f⇩1 f⇩2 P⇩1 P⇩2 (z x)),
(y = uz (func_mapper f⇩1 f⇩2 P⇩1 P⇩2 (z x)) ⟶
x ∈ Dz
∧ FC⇩1 f⇩1 (z x)
∧ (∀a. a ∈ Dom2 (z x) ⟶ f⇩2 a ∈ Rng2 (z x))
∧ func_mapper f⇩1 f⇩2 P⇩1 P⇩2 (z x) ∈ Du),
pred_mapper f⇩1 f⇩2 P⇩1 P⇩2 (z x))
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 prem
⟹ x ⦂ F⇩1 T⇩1 T⇩2 ✼ FW 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F⇩3 U⇩1 U⇩2 ✼ FR 𝗐𝗂𝗍𝗁 PP @tag 𝒯𝒫' ›
unfolding 𝗋Guard_def SE_Has_or_Not⇩2_alt_def φProd'_def
❴ premises FTF[] and SH⇩I[] and SH⇩E[] and Tr1 and Tr2 and [simp] and [simp]
apply_rule apply_Separation_Homo⇩I⇩2_Cond[where Fu=F⇩4 and Ft=F⇩1, OF SH⇩I, simplified]
apply_rule apply_Functional_CV_BiFunctor[where f⇩1=f⇩1 and P⇩1=P⇩1 and P⇩2=P⇩2, OF FTF, simplified]
❴ Tr1 ❵
❴ Tr2 ❵
apply_rule apply_Separation_Homo⇩E⇩2_Cond[OF SH⇩E, simplified]
❵ .
subsubsection ‹Transformation Mapper›
context
notes φProd_expn''[simp, φprogramming_simps] prod_opr_norm[simp] boolean_conversions[simp]
begin
lemma ToA_mapper_sep_template [φreason_template default %φmapToA_derived_TF name F⇩1.ToA_mapper_sep]:
‹ 𝗀𝗎𝖺𝗋𝖽 Functional_Transformation_Functor F⇩1⇩4 F⇩2⇩3 (T ∗ ◒[C⇩W] W) (U ∗ ◒[C⇩R] R) Dom Rng pred_mapper func_mapper
⟹ 𝗀𝗎𝖺𝗋𝖽 Parameter_Variant_of_the_Same_TypOpr F⇩1⇩4 F⇩1⇩4'
⟹ 𝗀𝗎𝖺𝗋𝖽 Functional_Transformation_Functor F⇩2⇩3' F⇩1⇩4' (U' ∗ ◒[C⇩R] R') (T' ∗ ◒[C⇩W] W') Dom' Rng' pred_mapper' func_mapper'
⟹ 𝗀𝗎𝖺𝗋𝖽 Separation_Homo⇩I_Cond F⇩1 F⇩4 F⇩1⇩4 C⇩W T W Dz z
⟹ 𝗀𝗎𝖺𝗋𝖽 Separation_Homo⇩I_Cond F⇩3' F⇩2' F⇩2⇩3' C⇩R U' R' Dz' z'
⟹ 𝗀𝗎𝖺𝗋𝖽 Separation_Homo⇩E_Cond F⇩3 F⇩2 F⇩2⇩3 C⇩R U R Du uz
⟹ 𝗀𝗎𝖺𝗋𝖽 Separation_Homo⇩E_Cond F⇩1' F⇩4' F⇩1⇩4' C⇩W T' W' Du' uz'
⟹ compositional_mapper m⇩1 (λh. func_mapper h (λ_. True)) m⇩2 Dm⇩1 (g ⊗⇩f r) h @tag 𝒜_template_reason undefined
⟹ separatable_cond_unzip C⇩R z' uz Du⇩s m⇩1 m⇩g m⇩r g r @tag 𝒜_template_reason undefined
⟹ compositional_mapper (λs. func_mapper' s (λ_. True)) m⇩2 m⇩3 Dm⇩2 s (g ⊗⇩f r o h) @tag 𝒜_template_reason undefined
⟹ separatable_cond_zip C⇩W uz' z Dz⇩s m⇩3 m⇩f m⇩w f w @tag 𝒜_template_reason undefined
⟹ domain_by_mapper Dom' m⇩2 Dom (g ⊗⇩f r o h) D⇩d⇩m @tag 𝒜_template_reason undefined
⟹ domain_of_inner_map m⇩3 Dm⇩3 @tag 𝒜_template_reason undefined
⟹ 𝗆𝖺𝗉 g ⊗⇩f r : U ✼ R ↦ U' ✼ R'
𝗈𝗏𝖾𝗋 f ⊗⇩f w : T ✼ W ↦ T' ✼ W'
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s 𝗂𝗇 ⋃ (Dom ` z ` D)
⟹ SE_Has_or_Not C⇩W W F⇩4 FW
⟹ SE_Has_or_Not C⇩W W' F⇩4' FW'
⟹ SE_Has_or_Not C⇩R R F⇩2 FR
⟹ SE_Has_or_Not C⇩R R' F⇩2' FR'
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇[𝗌𝖺𝖿𝖾] (C⇩R ∨ r = (λ_. unspec)) ∧ (C⇩W ∨ w = (λ_. unspec))
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀x∈D.
x ∈ Dz ∧ x ∈ Dz⇩s ∧ z x ∈ Dm⇩1 ∧ z x ∈ Dm⇩2 ∧ z x ∈ D⇩d⇩m ∧
(∀a ∈ Dm⇩3 (z x). a ∈ Dom (z x)) ∧
(∀a ∈ Dom (z x). h a ∈ Rng (z x)) ∧
(let x⇩1 = func_mapper h (λ_. True) (z x) in
x⇩1 ∈ Du ∧ x⇩1 ∈ Du⇩s ∧
(m⇩g g ⊗⇩f m⇩r r) (uz x⇩1) ∈ Dz' ∧
(∀a ∈ Dom' (m⇩2 (g ⊗⇩f r o h) (z x)). s a ∈ Rng' (m⇩2 (g ⊗⇩f r o h) (z x))) ∧
m⇩3 (f ⊗⇩f w) (z x) ∈ Du') )
⟹ 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 h' : uz o func_mapper h (λ_. True) o z @tag 𝒜_template_reason undefined
⟹ 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 s' : uz' o func_mapper' s (λ_. True) o z' @tag 𝒜_template_reason undefined
⟹ 𝗆𝖺𝗉 m⇩g g ⊗⇩f m⇩r r : F⇩3 U ✼ FR ↦ F⇩3' U' ✼ FR'
𝗈𝗏𝖾𝗋 m⇩f f ⊗⇩f m⇩w w : F⇩1 T ✼ FW ↦ F⇩1' T' ✼ FW'
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h' 𝗌𝖾𝗍𝗍𝖾𝗋 s' 𝗂𝗇 D›
unfolding 𝗋Guard_def Action_Tag_def separatable_unzip_def compositional_mapper_def
separatable_zip_def domain_of_inner_map_def NO_SIMP_def domain_by_mapper_def
separatable_cond_unzip_def separatable_cond_zip_def φProd'_def SE_Has_or_Not_alt_def
❴ premises FTF[] and [] and FTF'[] and SH⇩I[] and SH⇩I'[] and SH⇩E[] and SH⇩E'[]
and [useful] and [useful] and [useful] and [useful] and [useful] and [] and Tr
and [simp] and [simp] and [simp] and [simp] and _
and _ and [simp] and [simp]
apply_rule apply_Separation_Homo⇩I_Cond[OF SH⇩I, simplified]
apply_rule apply_Functional_Transformation_Functor[where f=h and P=‹λ_. True›, OF FTF, simplified]
❴ apply_rule ToA_Mapper_onward[OF Tr, simplified] ❵
apply_rule apply_Separation_Homo⇩E_Cond[OF SH⇩E, simplified] certified by (metis the_φ(3) the_φ(4))
❵ apply (rule conjunctionI, rule, simp add: image_image del: split_paired_All)
❴ premises FTF[] and [] and FTF'[] and SH⇩I[] and SH⇩I'[] and SH⇩E[] and SH⇩E'[]
and [useful] and [useful] and [useful] and [useful] and DM and DiM and Tr
and [simp] and [simp] and [simp] and [simp] and t1
and _ and [simp] and [simp]
apply_rule apply_Separation_Homo⇩I_Cond[OF SH⇩I', simplified]
certified by (instantiate ‹x›, insert useful(1), simp add: image_iff, elim bexE, metis the_φ(4)) ;;
apply_rule apply_Functional_Transformation_Functor[where f=s and P=‹λ_. True›, OF FTF', simplified]
❴ for a
apply_rule ToA_Mapper_backward[OF Tr, simplified]
certified proof (instantiate ‹a›,
insert ‹a ∈ Dom' (z' x)› ‹x ∈ (λx. (m⇩g g ⊗⇩f m⇩r r) (uz (func_mapper h (λ_. True) (z x)))) ` D›,
simp add: image_iff, elim bexE)
fix xa :: "'o × 'p"
assume a1: "xa ∈ D"
assume a2: "a ∈ Dom' (z' x)"
assume a3: "x = (m⇩g g ⊗⇩f m⇩r r) (uz (func_mapper h (λ_. True) (z xa)))"
have t1: "func_mapper h (λp. True) (z xa) ∈ Du⇩s"
using a1 by (metis (no_types) the_φ(5))
show "∃p∈D. ∃p∈Dom (z p). a = (g ⊗⇩f r) (h p)"
proof (rule bexI[OF _ a1])
have "∀P p f. ∃pa. ((p::'l × 'm) ∉ f ` P ∨ (pa::'a × 'b) ∈ P) ∧ (p ∉ f ` P ∨ f pa = p)"
by blast
then show "∃p∈Dom (z xa). a = (g ⊗⇩f r) (h p)"
by (cases ‹C⇩R›,
smt (z3) DM a1 a2 a3 subsetD the_φ(10) the_φ(11) the_φ(5),
smt (z3) DM a1 a2 a3 subsetD the_φ(10) the_φ(11) the_φ(5) the_φ(7))
qed
qed
❵ ; certified by (insert useful(1), simp add: image_iff, elim bexE,
metis the_φ(3) the_φ(5) the_φ(8) the_φ(9)) ;
apply_rule apply_Separation_Homo⇩E_Cond[OF SH⇩E', simplified]
certified proof -
obtain y where t1: ‹y ∈ D› and t2: ‹x = (m⇩g g ⊗⇩f m⇩r r) (uz (func_mapper h (λ_. True) (z y)))›
by (insert useful(2), blast)
have t3: ‹Dm⇩3 (z y) ⊆ Dom (z y)›
using t1 the_φ(4) by fastforce
have t4: ‹m⇩3 (s ∘ (g ⊗⇩f r ∘ h)) (z y) = m⇩3 (f ⊗⇩f w) (z y)›
by (insert ToA_Mapper_f_expn[OF Tr], clarsimp,
metis (mono_tags, opaque_lifting) DiM comp_apply t1 the_φ(4))
show ?thesis
by (insert ‹∀x∈D. _›[THEN bspec[OF _ t1]], simp add: t2 t4[symmetric],
metis the_φ(10) the_φ(6) the_φ(8) the_φ(9))
qed
❵ apply (rule conjunctionI, simp, drule ToA_Mapper_f_expn,
simp add: Premise_def Simplify_def subset_iff del: split_paired_All,
rule)
subgoal premises prems for x
proof -
have t1: ‹Dm⇩3 (z x) ⊆ Dom (z x)›
using prems(19) prems(23) by blast
have t2: ‹m⇩3 (s ∘ (g ⊗⇩f r ∘ h)) (z x) = m⇩3 (f ⊗⇩f w) (z x)›
by (rule ‹∀f g x. (∀a∈Dm⇩3 x. f a = g a) ⟶ m⇩3 f x = m⇩3 g x›[THEN spec, THEN spec, THEN spec, THEN mp],
insert prems(22) prems(23) t1, fastforce)
show ?thesis
by (metis prems(10) prems(11) prems(18) prems(19) prems(23) prems(8) prems(9) t2)
qed .
lemma ToA_mapper_template[φreason_template default %φmapToA_derived_TF name F⇩1.ToA_mapper]:
‹ 𝗀𝗎𝖺𝗋𝖽 Functional_Transformation_Functor F⇩1 F⇩2 T U Dom Rng pred_mapper func_mapper
⟹ 𝗀𝗎𝖺𝗋𝖽 Parameter_Variant_of_the_Same_TypOpr F⇩1 F⇩1'
⟹ 𝗀𝗎𝖺𝗋𝖽 Functional_Transformation_Functor F⇩2' F⇩1' U' T' Dom' Rng' pred_mapper' func_mapper'
⟹ compositional_mapper m⇩1 (λh. func_mapper h (λ_. True)) m⇩2 Dm⇩1 g h @tag 𝒜_template_reason undefined
⟹ compositional_mapper (λs. func_mapper' s (λ_. True)) m⇩2 m⇩3 Dm⇩2 s (g o h) @tag 𝒜_template_reason undefined
⟹ domain_by_mapper Dom' m⇩2 Dom (g o h) D⇩d⇩m @tag 𝒜_template_reason undefined
⟹ domain_of_inner_map m⇩3 Dm⇩3 @tag 𝒜_template_reason undefined
⟹ 𝗆𝖺𝗉 g : U ↦ U' 𝗈𝗏𝖾𝗋 f : T ↦ T'
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s 𝗂𝗇 ⋃ (Dom ` D)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀x∈D.
x ∈ Dm⇩1 ∧ x ∈ Dm⇩2 ∧ x ∈ D⇩d⇩m ∧
(∀a ∈ Dm⇩3 x. a ∈ Dom x) ∧
(∀a ∈ Dom x. h a ∈ Rng x) ∧
(let x⇩1 = func_mapper h (λ_. True) x in
(∀a ∈ Dom' (m⇩2 (g o h) x). s a ∈ Rng' (m⇩2 (g o h) x)) ))
⟹ 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 h' : func_mapper h (λ_. True) @tag 𝒜_template_reason undefined
⟹ 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 s' : func_mapper' s (λ_. True) @tag 𝒜_template_reason undefined
⟹ 𝗆𝖺𝗉 m⇩1 g : F⇩2 U ↦ F⇩2' U' 𝗈𝗏𝖾𝗋 m⇩3 f : F⇩1 T ↦ F⇩1' T'
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h' 𝗌𝖾𝗍𝗍𝖾𝗋 s' 𝗂𝗇 D›
unfolding 𝗋Guard_def Action_Tag_def compositional_mapper_def
domain_of_inner_map_def NO_SIMP_def domain_by_mapper_def
❴ premises FTF[] and [] and FTF'[] and [useful] and [useful] and [useful] and [useful] and Tr
and _ and [simp] and [simp]
apply_rule apply_Functional_Transformation_Functor[where U=U and f=h and P=‹λ_. True›, OF FTF]
❴ apply_rule ToA_Mapper_onward[OF Tr] ❵
❵ apply (rule conjunctionI, rule)
❴ premises FTF[] and [] and FTF'[] and [useful] and [useful] and [useful] and [useful] and Tr
and _ and [simp] and [simp]
apply_rule apply_Functional_Transformation_Functor[where f=s and P=‹λ_. True›, OF FTF']
❴ for a apply_rule ToA_Mapper_backward[OF Tr]
certified by (insert ‹a ∈ Dom' x› ‹x ∈ m⇩1 g ` func_mapper h (λ_. True) ` D›,
simp add: image_iff, elim bexE,
insert the_φ(4) the_φ(6) the_φ(8), fastforce)
❵
❵
by (rule conjunctionI, simp, drule ToA_Mapper_f_expn,
simp add: Premise_def Simplify_def subset_iff del: split_paired_All)
end
subsubsection ‹Semimodule Scalar Associative \label{Semimodule-Scalar-Associative}›
text ‹The proof search is inefficient for semimodule φ-type that satisfies both scalar associativity
and scalar distributivity.
This inefficiency stems from the two properties deriving rules that can be interchangeably applied.
Given a φ-type ‹F a T› and expect ‹F b U› with ‹a ≠ b›, we might identify some ‹c› with ‹c * a = b›,
so we apply the associative rule and go to element transformations expecting the inner φ-type ‹T›
might supply the missing ‹F c U›;
alternatively we can also identify a certain ‹c› with ‹c + a = b›, so we apply the distributive rule
and hope the unexplored external portion of assertion contains the ‹F c U›.
The situation is further complicated when the two rules are combined: the inner φ-type ‹T› may
contain some part ‹c⇩1› while the external part contains the remaining part ‹c⇩2›,
‹c⇩2 + c⇩1 * a = b›.
To tackle this complexity, we introduce a normalization step before the reasoning,
where we exhaustively apply the associative rules to eliminate any further need for them in the later reasoning.
Viewing a φ-type expression as a tree with type operators as nodes and atomic types as leaves,
we push every module-like type operators ‹F a T› all the way down to the leaves, passing through type
connectives like ‹∗› and ‹❙→› by meas of homomorphic rules like ‹F a (T ∗ U) = (F a T) ∗ (F a U)›.
In this way, all the module operator are gathered at the leaves.
By exhaustively applying the associative rules on them, any need of associative rules
is fully addressed, and consequently, in the subsequent reasoning, we can exclusively focus on
the scalar distribution rules.
Sure it raises further works for deriving the homomorphic rules. It can be done by a deriver generating
that ....
›
text ‹According to the discussion above, the rule below should be used only for non-distributive scalars.›
lemma SE_Semimodule_Scalar_right
[φreason_template default %derived_SE_scalar_assoc name: F3⇩b.ToR_scala_assoc_right]:
‹ 𝗀𝗎𝖺𝗋𝖽 common_multiplicator_2 smul a c b
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 D⇩a a ∧ D⇩c c
⟹ Module_Assoc⇩I F3⇩a F3⇩c F3⇩b U D⇩a D⇩c D⇩x smul g⇩s
⟹ Type_Variant_of_the_Same_Scalar_Mul F3⇩a F1
⟹ Type_Variant_of_the_Same_Scalar_Mul F3⇩a F4
⟹ Type_Variant_of_the_Same_Scalar_Mul F3⇩a F2
⟹ Functional_Transformation_Functor (F1 a) (F3⇩a a) T (F3⇩c c U) Dom Rng pred_mapper func_mapper
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀a. a ∈ Dom x ⟶ f a ∈ Rng x) ∧ D⇩x a c (func_mapper f P x)
⟹ (⋀x ∈ Dom x. x ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f x ⦂ F3⇩c c U 𝗐𝗂𝗍𝗁 P x @tag 𝒯𝒫)
⟹ x ⦂ F1 a T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 g⇩s a c (func_mapper f P x) ⦂ F3⇩b b U
𝗐𝗂𝗍𝗁 pred_mapper f P x @tag 𝒯𝒫 ›
unfolding 𝗋Guard_def common_multiplicator_2_def
❴ premises [simp] and _ and SA[] and _ and _ and _ and FTF[] and _ and Tr[]
apply_rule apply_Functional_Transformation_Functor[where f=f and P=P, OF FTF]
❴ Tr ❵
apply_rule apply_Semimodule_SAssoc⇩I[OF SA]
❵ .
lemma SE_Semimodule_Scalar_left
[φreason_template default %derived_SE_scalar_assoc name: F1⇩b.ToR_scala_assoc_left]:
‹ 𝗀𝗎𝖺𝗋𝖽 common_multiplicator_2 smul a c b
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 D⇩a a ∧ D⇩c c
⟹ Module_Assoc⇩E F1⇩a F1⇩c F1⇩b T D⇩a D⇩c D⇩x smul g⇩s
⟹ Type_Variant_of_the_Same_Scalar_Mul F1⇩a F3
⟹ Type_Variant_of_the_Same_Scalar_Mul F1⇩a F4
⟹ Type_Variant_of_the_Same_Scalar_Mul F1⇩a F2
⟹ Functional_Transformation_Functor (F1⇩a a) (F3 a) (F1⇩c c T) U Dom Rng pred_mapper func_mapper
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D⇩x a c x ∧ (∀e ∈ Dom (g⇩s a c x). f e ∈ Rng (g⇩s a c x)) ∧
func_mapper f P (g⇩s a c x) ∈ Du
⟹ (⋀x ∈ Dom (g⇩s a c x). x ⦂ F1⇩c c T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f x ⦂ U 𝗐𝗂𝗍𝗁 P x @tag 𝒯𝒫 )
⟹ x ⦂ F1⇩b b T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 func_mapper f P (g⇩s a c x) ⦂ F3 a U
𝗐𝗂𝗍𝗁 pred_mapper f P (g⇩s a c x) @tag 𝒯𝒫 ›
unfolding 𝗋Guard_def common_multiplicator_2_def
❴ premises A and _ and SA[] and _ and _ and _ and FTF[] and _ and Tr[]
apply_rule apply_Semimodule_SAssoc⇩E[where s=a and t=c and smul=smul, OF SA, unfolded A]
apply_rule apply_Functional_Transformation_Functor[where f=f and P=P, OF FTF]
❴ Tr ❵
❵ .
lemma SE_Semimodule_Scalar_partial_right:
‹ 𝗀𝗎𝖺𝗋𝖽 common_multiplicator_2 smul a c b
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 D⇩a a ∧ D⇩c c
⟹ Module_Assoc⇩I F3⇩a F3⇩c F3⇩b U D⇩a D⇩c D⇩x smul g⇩s
⟹ Type_Variant_of_the_Same_Scalar_Mul F3⇩a F1
⟹ Type_Variant_of_the_Same_Scalar_Mul F3⇩a F4
⟹ Type_Variant_of_the_Same_Scalar_Mul F3⇩a F2
⟹ Separation_Homo⇩I_Cond (F1 a) (F4 a) F14 C⇩W T W Dz z
⟹ Separation_Homo⇩E_Cond (F3⇩a a) (F2 a) F23 C⇩R (F3⇩c c U) R Du uz
⟹ Functional_Transformation_Functor F14 F23 (T ∗ ◒[C⇩W] W) (F3⇩c c U ∗ ◒[C⇩R] R) Dom Rng pred_mapper func_mapper
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x ∈ Dz ∧ (∀a. a ∈ Dom (z x) ⟶ f a ∈ Rng (z x)) ∧
func_mapper f P (z x) ∈ Du ∧
D⇩x a c (fst (uz (func_mapper f P (z x))))
⟹ (⋀a ∈ Dom (z x). a ⦂ T ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f a ⦂ F3⇩c c U ✼ R 𝗐𝗂𝗍𝗁 P a @tag 𝒯𝒫' )
⟹ SE_Has_or_Not C⇩W W (F4 a) FW
⟹ SE_Has_or_Not C⇩R R (F2 a) FR
⟹ x ⦂ F1 a T ✼ FW
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 apfst (g⇩s a c) (uz (func_mapper f P (z x))) ⦂ F3⇩b b U ✼ FR
𝗐𝗂𝗍𝗁 pred_mapper f P (z x) @tag 𝒯𝒫' ›
unfolding 𝗋Guard_def common_multiplicator_2_def φProd'_def SE_Has_or_Not_alt_def
❴ premises [simp] and _ and SA and _ and _ and _ and SH⇩I and SH⇩E and FTF and _ and Tr and [simp] and [simp]
apply_rule apply_Separation_Homo⇩I_Cond[OF SH⇩I, simplified]
apply_rule apply_Functional_Transformation_Functor[where f=f and P=P, OF FTF, simplified]
❴ Tr ❵ certified by auto_sledgehammer ;
apply_rule apply_Separation_Homo⇩E_Cond[OF SH⇩E, simplified]
apply_rule apply_Semimodule_SAssoc⇩I[OF SA, THEN transformation_right_frame_ty, simplified]
❵ .
declare SE_Semimodule_Scalar_partial_right[
φreason_template default %derived_SE_scalar_assoc name: F3⇩b.ToR_scala_assoc_partial_right]
lemma SE_Semimodule_Scalar_partial_left
[φreason_template default %derived_SE_scalar_assoc name: F1⇩b.ToR_scala_assoc_partial_left]:
‹ 𝗀𝗎𝖺𝗋𝖽 common_multiplicator_2 smul a c b
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 D⇩a a ∧ D⇩c c
⟹ Module_Assoc⇩E F1⇩a F1⇩c F1⇩b T D⇩a D⇩c D⇩x smul g⇩s
⟹ Type_Variant_of_the_Same_Scalar_Mul F1⇩a F3
⟹ Type_Variant_of_the_Same_Scalar_Mul F1⇩a F4
⟹ Type_Variant_of_the_Same_Scalar_Mul F1⇩a F2
⟹ Separation_Homo⇩I_Cond (F1⇩a a) (F4 a) F14 C⇩W (F1⇩c c T) W Dz z
⟹ Separation_Homo⇩E_Cond (F3 a) (F2 a) F23 C⇩R U R Du uz
⟹ Functional_Transformation_Functor F14 F23 (F1⇩c c T ∗ ◒[C⇩W] W) (U ∗ ◒[C⇩R] R) Dom Rng pred_mapper func_mapper
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 apfst (g⇩s a c) x ∈ Dz ∧ D⇩x a c (fst x) ∧
(∀x' ∈ Dom (z (apfst (g⇩s a c) x)). f x' ∈ Rng (z (apfst (g⇩s a c) x))) ∧
func_mapper f P (z (apfst (g⇩s a c) x)) ∈ Du
⟹ (⋀a ∈ Dom (z (apfst (g⇩s a c) x)). a ⦂ F1⇩c c T ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f a ⦂ U ✼ R 𝗐𝗂𝗍𝗁 P a @tag 𝒯𝒫')
⟹ SE_Has_or_Not C⇩W W (F4 a) FW
⟹ SE_Has_or_Not C⇩R R (F2 a) FR
⟹ x ⦂ F1⇩b b T ✼ FW
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 uz (func_mapper f P (z (apfst (g⇩s a c) x))) ⦂ F3 a U ✼ FR
𝗐𝗂𝗍𝗁 pred_mapper f P (z (apfst (g⇩s a c) x)) @tag 𝒯𝒫' ›
unfolding 𝗋Guard_def common_multiplicator_2_def φProd'_def SE_Has_or_Not_alt_def
❴ premises A and _ and SA[] and _ and _ and _ and SH⇩I[] and SH⇩E[] and FTF[] and _ and Tr[] and [simp] and [simp]
apply_rule apply_Semimodule_SAssoc⇩E[where s=a and t=c and smul=smul, OF SA, unfolded A, simplified]
apply_rule apply_Separation_Homo⇩I_Cond[OF SH⇩I, simplified]
apply_rule apply_Functional_Transformation_Functor[where f=f and P=P, OF FTF, simplified]
❴ Tr ❵
apply_rule apply_Separation_Homo⇩E_Cond[OF SH⇩E, simplified]
❵ .
paragraph ‹Transformation Mapper›
lemma SE_Module_scalar_assoc_mapper_tgt_template
[no_atp, φreason_template default %φmapToA_derived_module_assoc name F⇩3⇩b.assoc_mapper_tgt]:
‹ 𝗀𝗎𝖺𝗋𝖽 common_multiplicator_2 smul a c b
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 a' = a ∧ b' = b ∧ D⇩a a ∧ D⇩c c
⟹ Module_Assoc⇩I F⇩3⇩a F⇩3⇩c F⇩3⇩b U D⇩a D⇩c D⇩x smul g⇩I
⟹ Type_Variant_of_the_Same_Scalar_Mul F⇩3⇩a F⇩3⇩a'
⟹ Type_Variant_of_the_Same_Scalar_Mul F⇩3⇩a F⇩1
⟹ Type_Variant_of_the_Same_Scalar_Mul F⇩3⇩a F⇩1'
⟹ Module_Assoc⇩E F⇩3⇩a' F⇩3⇩c' F⇩3⇩b' U' D⇩a D⇩c D⇩x' smul g⇩E
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀x∈D. D⇩x a c (fst (h x)) ∧ D⇩x' a c (g (g⇩I a c (fst (h x)))))
⟹ 𝗆𝖺𝗉 (g⇩E a c o g o g⇩I a c) ⊗⇩f r : F⇩3⇩a a (F⇩3⇩c c U) ✼ R ↦ F⇩3⇩a' a (F⇩3⇩c' c U') ✼ R'
𝗈𝗏𝖾𝗋 f ⊗⇩f w : F⇩1 a T ✼ W ↦ F⇩1' a T' ✼ W'
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s
𝗂𝗇 D
⟹ 𝗆𝖺𝗉 g ⊗⇩f r : F⇩3⇩b b U ✼ R ↦ F⇩3⇩b' b' U' ✼ R'
𝗈𝗏𝖾𝗋 f ⊗⇩f w : F⇩1 a T ✼ W ↦ F⇩1' a' T' ✼ W'
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 apfst (g⇩I a c) o h 𝗌𝖾𝗍𝗍𝖾𝗋 s o apfst (g⇩E a c)
𝗂𝗇 D ›
unfolding 𝗋Guard_def common_multiplicator_2_def φProd'_def
❴ premises A and _ and SA⇩I[] and [] and [] and [] and SA⇩E[] and _ and Tr[]
apply_rule ToA_Mapper_onward[OF Tr, where x=x]
apply_rule apply_Semimodule_SAssoc⇩I[where s=a and t=c, OF SA⇩I, unfolded A]
❵ apply (rule conjunctionI, rule)
❴ premises A and B and SA⇩I[] and [] and [] and [] and SA⇩E[] and _ and Tr[]
unfold ‹b' = b›
apply_rule apply_Semimodule_SAssoc⇩E[where s=a and t=c, OF SA⇩E, unfolded A]
certified by auto_sledgehammer ;;
apply_rule ToA_Mapper_backward[OF Tr, where x=‹apfst (g⇩E a c) x›]
certified by (insert ToA_Mapper_f_expn[OF Tr], auto_sledgehammer) ;;
fold ‹a' = a›
❵ by (rule conjunctionI, rule, drule ToA_Mapper_f_expn, clarsimp simp: prod.map_beta)
lemma SE_Module_scalar_assoc_mapper_src_template
[no_atp, φreason_template default %φmapToA_derived_module_assoc name F⇩3⇩b.assoc_mapper_src]:
‹ 𝗀𝗎𝖺𝗋𝖽 common_multiplicator_2 smul a c b
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 a' = a ∧ b' = b ∧ D⇩a a ∧ D⇩c c
⟹ Module_Assoc⇩E F⇩3⇩a F⇩3⇩c F⇩3⇩b U D⇩a D⇩c D⇩x smul g⇩E
⟹ Type_Variant_of_the_Same_Scalar_Mul F⇩3⇩a F⇩3⇩a'
⟹ Type_Variant_of_the_Same_Scalar_Mul F⇩3⇩a F⇩1
⟹ Type_Variant_of_the_Same_Scalar_Mul F⇩3⇩a F⇩1'
⟹ Module_Assoc⇩I F⇩3⇩a' F⇩3⇩c' F⇩3⇩b' U' D⇩a D⇩c D⇩x' smul g⇩I
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀x∈D. D⇩x a c (fst x) ∧ D⇩x' a c (f (g⇩E a c (fst x))))
⟹ 𝗆𝖺𝗉 g ⊗⇩f r : F⇩1 a T ✼ R ↦ F⇩1' a T' ✼ R'
𝗈𝗏𝖾𝗋 f ⊗⇩f w : F⇩3⇩a a (F⇩3⇩c c U) ✼ W ↦ F⇩3⇩a' a (F⇩3⇩c' c U') ✼ W'
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s
𝗂𝗇 apfst (g⇩E a c) ` D
⟹ 𝗆𝖺𝗉 g ⊗⇩f r : F⇩1 a T ✼ R ↦ F⇩1' a' T' ✼ R'
𝗈𝗏𝖾𝗋 (g⇩I a c o f o g⇩E a c) ⊗⇩f w : F⇩3⇩b b' U ✼ W ↦ F⇩3⇩b' b U' ✼ W'
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h o apfst (g⇩E a c) 𝗌𝖾𝗍𝗍𝖾𝗋 apfst (g⇩I a c) o s
𝗂𝗇 D ›
unfolding 𝗋Guard_def common_multiplicator_2_def φProd'_def
apply (simp add: φProd_expn'' φProd_expn' )
❴ premises A and _ and SA⇩E[] and [] and [] and [] and SA⇩I[] and _ and Tr[]
unfold ‹b' = b›
apply_rule apply_Semimodule_SAssoc⇩E[where s=a and t=c, OF SA⇩E, unfolded A]
apply_rule ToA_Mapper_onward[OF Tr, where x=‹apfst (g⇩E a c) x›]
❵ apply (rule conjunctionI, rule)
❴ premises A and _ and SA⇩E[] and [] and [] and [] and SA⇩I[] and _ and Tr[]
unfold ‹a' = a›
apply_rule ToA_Mapper_backward[OF Tr, where x=‹x›]
apply_rule apply_Semimodule_SAssoc⇩I[where s=a and t=c, OF SA⇩I, unfolded A]
certified by (insert ToA_Mapper_f_expn[OF Tr], auto_sledgehammer)
❵ by (rule conjunctionI, rule, drule ToA_Mapper_f_expn, clarsimp, auto_sledgehammer)
subparagraph ‹With Parameterization›
subsection ‹Separation Extraction of Semimodule Left Distributivity›
paragraph ‹Commutative, Non-Unital Associative, No Additive Zero›
text ‹Non-unital algebra implies no additive zero.›
ML_file ‹library/phi_type_algebra/semimodule_rule_pass.ML›
lemma SE_Module_SDistr_da_bc
[φreason_template default %derived_SE_sdistr pass: phi_TA_Module_Distrib_rule_pass_no_comm_scalar]:
‹ NO_SIMP (𝗀𝗎𝖺𝗋𝖽 dabc_equation d a b c)
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩S F⇩1 Ds Dx uz
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩Z F⇩1 Ds Dx' z
⟹ Type_Variant_of_the_Same_Scalar_Mul⇩0 F⇩1 F⇩3
⟹ NO_MATCH (a'::'s'::partial_ab_semigroup_add) a @tag 𝒜_template_reason None
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ds a ∧ Ds d ∧ Ds c ∧ Ds b
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 Dx' d a (x⇩d, fst x) ∧ Dx b c (z d a (x⇩d, fst x))
⟹ (fst (uz b c (z d a (x⇩d, fst x))), w) ⦂ F⇩1 b ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F⇩3 b ✼ R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫'
⟹ snd x ⦂ WW 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 (x⇩d, w) ⦂ F⇩1 d ∗ W @clean
⟹ (snd y, snd (uz b c (z d a (x⇩d, fst x)))) ⦂ R ∗ F⇩1 c 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 rr ⦂ RR @clean
⟹ x ⦂ F⇩1 a ✼ WW 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 (fst y, rr) ⦂ F⇩3 b ✼ RR 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫' ›
for W :: ‹('c::sep_algebra,'d) φ›
unfolding Action_Tag_def 𝗋Guard_def NO_SIMP_def φProd'_def
apply (drule dabc_equation_D_main,
simp add: φProd_expn'' φProd_expn' φSome_φProd[symmetric])
❴ premises SD⇩U[] and SD⇩Z[] and _ and _ and _ and Tr[] and C1[] and C2 and b[simp]
C1
apply_rule apply_Module_Distr_Homo⇩Z[where s=d and t=a and F=F⇩1 and x=‹(x⇩d, fst x)›, OF SD⇩Z]
apply_rule apply_Module_Distr_Homo⇩S[where s=b and t=c and F=F⇩1, OF SD⇩U]
Tr
C2
❵ .
lemma SE_Module_SDistr_ad_cb
[φreason_template default %derived_SE_sdistr pass: phi_TA_Module_Distrib_rule_pass_no_comm_scalar]:
‹ NO_SIMP (𝗀𝗎𝖺𝗋𝖽 dabc_equation c b a d)
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩S F⇩1 Ds Dx uz
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩Z F⇩1 Ds Dx' z
⟹ Type_Variant_of_the_Same_Scalar_Mul⇩0 F⇩1 F⇩3
⟹ NO_MATCH (a'::'s'::partial_ab_semigroup_add) a @tag 𝒜_template_reason None
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ds a ∧ Ds d ∧ Ds c ∧ Ds b
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 Dx' a d (fst x, fst xw) ∧ Dx c b (z a d (fst x, fst xw))
⟹ (snd (uz c b (z a d (fst x, fst xw))), snd xw) ⦂ F⇩1 b ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F⇩3 b ✼ R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫'
⟹ snd x ⦂ W' 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 xw ⦂ F⇩1 d ∗ W @clean
⟹ (fst (uz c b (z a d (fst x, fst xw))), snd y) ⦂ F⇩1 c ∗ R 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 r' ⦂ R' @clean
⟹ x ⦂ F⇩1 a ✼ W' 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 (fst y, r') ⦂ F⇩3 b ✼ R' 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫' ›
for W :: ‹('c::sep_algebra,'d) φ›
unfolding Action_Tag_def 𝗋Guard_def NO_SIMP_def φProd'_def
apply (drule dabc_equation_D_main;
simp add: φProd_expn'' φProd_expn' φSome_φProd[symmetric] )
❴ premises _ and _ and _ and [simp] and [simp] and Tr[] and C1[] and C2 and [simp]
note φProd_expn''[simp] φProd_expn'[simp]
; C1
apply_rule apply_Module_Distr_Homo⇩Z[where s=a and t=d and F=F⇩1 and x=‹(fst x, fst xw)›]
apply_rule apply_Module_Distr_Homo⇩S[where s=c and t=b and F=F⇩1, simplified]
Tr
C2
❵ .
lemma SE_Module_SDistr_a_dbc
[φreason_template default %derived_SE_sdistr+1]:
‹ NO_SIMP (𝗀𝗎𝖺𝗋𝖽 equation⇩3⇩1_cond C⇩d C⇩c d b db c a)
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩S F⇩1 Ds Dx uz
⟹ Type_Variant_of_the_Same_Scalar_Mul⇩0 F⇩1 F⇩3
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (C⇩c ⟶ Ds c ∧ Ds db) ∧ (C⇩d ⟶ Ds d ∧ Ds b)
⟹ 𝗀𝗎𝖺𝗋𝖽 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 x' : (snd (?⇩s⇩L C⇩d (uz d b) (fst (?⇩s⇩R C⇩c (uz db c) (fst x)))), snd x)
⟹ 𝗀𝗎𝖺𝗋𝖽 x' ⦂ F⇩1 b ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F⇩3 b ✼ R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫'
⟹ (⋀A w. 𝗀𝗎𝖺𝗋𝖽 𝗋Comm_Mul A (w ⦂ W))
⟹ (⋀x A. 𝗀𝗎𝖺𝗋𝖽 𝗋Comm_Mul (x ⦂ ◒[C⇩d] F⇩1 d) A)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (C⇩c ⟶ Dx db c (fst x)) ∧ (C⇩d ⟶ Dx d b (fst (?⇩s⇩R C⇩c (uz db c) (fst x))))
⟹ (snd y, fst (?⇩s⇩L C⇩d (uz d b) (fst (?⇩s⇩R C⇩c (uz db c) (fst x)))), snd (?⇩s⇩R C⇩c (uz db c) (fst x))) ⦂ R ∗ ◒[C⇩d] F⇩1 d ∗ ◒[C⇩c] F⇩1 c
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 r ⦂ R' @clean
⟹ x ⦂ F⇩1 a ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 (fst y, r) ⦂ F⇩3 b ✼ R' 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫' ›
for R :: ‹('c::sep_monoid,'d) φ›
unfolding Action_Tag_def 𝗋Guard_def NO_SIMP_def φProd'_def
❴ premises [unfolded equation⇩3⇩1_cond_def, simp] and SU[] and _ and _ and _ and Tr[] and swap1 and swap2 and _ and CC[]
; apply_rule apply_Module_Distr_Homo⇩S_RCond[OF SU, where s=‹db› and t=c and r=a and C=C⇩c]
apply_rule apply_Module_Distr_Homo⇩S_LCond[OF SU, where s=‹d› and t=b and r=db and C=C⇩d]
apply_rule 𝗋Comm_Mul.apply[OF swap2[where A=‹x ⦂ F⇩1 b› for x]]
apply_rule 𝗋Comm_Mul.apply[
OF swap1[where A=‹(x ⦂ ◒[C⇩d] F⇩1 d) * (y ⦂ ◒[C⇩c] F⇩1 c)› for x y],
THEN transformation_left_frame[where R=‹x ⦂ F⇩1 b› for x]]
Tr
apply_rule CC[THEN transformation_left_frame[where R=‹x ⦂ F⇩3 b› for x]]
❵ .
lemma SE_Module_SDistr_dac_b
[φreason_template default %derived_SE_sdistr+1]:
‹ NO_SIMP (𝗀𝗎𝖺𝗋𝖽 equation⇩3⇩1_cond C⇩d C⇩c d a da c b)
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩Z F⇩1 Ds Dx z
⟹ Type_Variant_of_the_Same_Scalar_Mul⇩0 F⇩1 F⇩3
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (C⇩d ⟶ Ds d ∧ Ds a) ∧ (C⇩c ⟶ Ds da ∧ Ds c)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (C⇩d ⟶ Dx d a (x⇩d, fst x)) ∧
(C⇩c ⟶ Dx da c (?⇩j⇩L C⇩d (z d a) (x⇩d, fst x), x⇩c))
⟹ 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 x' : (?⇩j⇩R C⇩c (z da c) (?⇩j⇩L C⇩d (z d a) (x⇩d, fst x), x⇩c), w)
⟹ x' ⦂ F⇩1 b ✼ W 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F⇩3 b ✼ R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫'
⟹ (⋀x A. 𝗀𝗎𝖺𝗋𝖽 𝗋Comm_Mul A (x ⦂ ◒[C⇩d] F⇩1 d))
⟹ snd x ⦂ W' 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 (x⇩d, x⇩c, w) ⦂ ◒[C⇩d] F⇩1 d ∗ ◒[C⇩c] F⇩1 c ∗ W @clean
⟹ x ⦂ F⇩1 a ✼ W' 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F⇩3 b ✼ R 𝗐𝗂𝗍𝗁 P @tag 𝒯𝒫' ›
for R :: ‹('c::sep_monoid,'d) φ›
unfolding Action_Tag_def 𝗋Guard_def NO_SIMP_def φProd'_def
❴ premises A[unfolded equation⇩3⇩1_cond_def, simp] and _ and _ and _ and _ and _
and Tr[] and swap1 and C1[]
apply_rule C1[THEN transformation_left_frame[where R=‹fst x ⦂ F⇩1 a›]]
apply_rule 𝗋Comm_Mul.apply[OF swap1[where A=‹fst x ⦂ F⇩1 a›]]
apply_rule apply_Module_Distr_Homo⇩Z_LCond_φSome[where s=d and t=a and F=F⇩1 and r=da and x=‹(x⇩d, fst x)› and C=C⇩d]
apply_rule apply_Module_Distr_Homo⇩Z_RCond_φSome[where s=da and t=c and F=F⇩1 and x=‹(?⇩j⇩L C⇩d (z d a) (x⇩d, fst x), x⇩c)› and C=C⇩c]
Tr
❵ .
subsection ‹ToA mapper over Semimodules›
context notes prod_opr_norm[simp] φProd_expn''[simp] comp_assoc[symmetric, simp]
begin
lemma SE_Module_SDistr_da_bc_ToA_mapper
[φreason_template default %φmapToA_derived_module_SDistri
name F⇩1.module_mapper⇩d⇩a⇩_⇩b⇩c
pass: phi_TA_Module_Distrib_rule_pass_no_comm_scalar]:
‹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 a' = a ∧ b' = b ∧ c' = c
⟹ NO_SIMP (𝗀𝗎𝖺𝗋𝖽 dabc_equation d a b c)
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩S F⇩1 Ds Dx⇩u uz
⟹ Type_Variant_of_the_Same_Scalar_Mul⇩0 F⇩1 F⇩3
⟹ Type_Variant_of_the_Same_Scalar_Mul⇩0 F⇩1 F⇩1'
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩Z F⇩1 Ds Dx⇩z z
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩S F⇩1' Ds' Dx⇩u' uz'
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩Z F⇩1' Ds' Dx⇩z' z'
⟹ NO_MATCH (a''::'s'::partial_ab_semigroup_add) a @tag 𝒜_template_reason None
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ds d ∧ Ds a ∧ Ds b ∧ Ds c ∧ Ds' b ∧ Ds' c ∧ Ds' d ∧ Ds' a
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀(x⇩a,w,x⇩d)∈D. let (y, y⇩c) = uz b c (z d a (x⇩d,x⇩a))
in D⇩s⇩z (x⇩d,x⇩a) (f⇩b y, f⇩c y⇩c) ∧
Dx⇩z d a (x⇩d,x⇩a) ∧
Dx⇩u b c (z d a (x⇩d,x⇩a)) ∧
Dx⇩z' b c (f⇩b y, f⇩c y⇩c) ∧
Dx⇩u' d a (z' b c (f⇩b y, f⇩c y⇩c)) )
⟹ 𝗆𝖺𝗉 g ⊗⇩f r : F⇩3 b ✼ R ↦ F⇩3' b ✼ R'
𝗈𝗏𝖾𝗋 f⇩b ⊗⇩f w : F⇩1 b ✼ W ↦ F⇩1' b ✼ W'
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s
𝗂𝗇 (λ(x⇩a,w,x⇩d). case uz b c (z d a (x⇩d,x⇩a)) of (x⇩b,x⇩c) ⇒ (x⇩b,w)) ` D
⟹ separatable_module_zip True d a b c uz' z' uz z D⇩s⇩z f⇩b f⇩c f⇩d f⇩a @tag 𝒜_template_reason undefined
⟹ 𝗆𝖺𝗉 g ⊗⇩f (r ⊗⇩f f⇩c) : F⇩3 b ✼ R ∗ F⇩1 c ↦ F⇩3' b' ✼ R' ∗ F⇩1' c'
𝗈𝗏𝖾𝗋 f⇩a ⊗⇩f w ⊗⇩f f⇩d : F⇩1 a ✼ W ∗ F⇩1 d ↦ F⇩1' a' ✼ W' ∗ F⇩1' d
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 SIMP (λ(x⇩a,w,x⇩d). let (x⇩b,x⇩c) = uz b c (z d a (x⇩d,x⇩a))
; (y,r) = h (x⇩b,w)
in (y,r,x⇩c))
𝗌𝖾𝗍𝗍𝖾𝗋 SIMP (λ(y,r,x⇩c). let (x⇩b,w) = s (y,r)
; (x⇩d,x⇩a) = uz' d a (z' b c (x⇩b,x⇩c))
in (x⇩a,w,x⇩d))
𝗂𝗇 D ›
for F⇩1 :: ‹'s::partial_add_magma ⇒ ('c::sep_algebra, 'a) φ›
unfolding Action_Tag_def 𝗋Guard_def NO_SIMP_def Type_Variant_of_the_Same_Scalar_Mul⇩0_def φProd'_def
apply simp
❴ premises _ and A[THEN dabc_equation_D_main, simp] and _ and _ and _ and _ and _ and _ and Tr
apply_rule apply_Module_Distr_Homo⇩Z[where t=a and s=d and F=F⇩1 and x=‹case x of (x⇩a,w,x⇩d) ⇒ (x⇩d,x⇩a)›]
certified by (insert useful(1) useful(2)[THEN bspec[OF _ ‹x ∈ D›]],
clarsimp split: prod.split simp add: useful(3-)) ;
apply_rule apply_Module_Distr_Homo⇩S[where t=c and s=b and F=F⇩1]
certified by (insert useful(1) useful(2)[THEN bspec[OF _ ‹x ∈ D›]],
clarsimp split: prod.split simp add: useful(3-)) ; ;;
apply_rule ToA_Mapper_onward[OF Tr, where x=‹case x of (x⇩a,w,x⇩d) ⇒ case uz b c (z d a (x⇩d,x⇩a)) of (x⇩b,x⇩c) ⇒ (x⇩b,w)›]
certified by (clarsimp split: prod.split simp add: φ image_iff, insert φ(4), force)
❵ certified by (clarsimp split: prod.split)
apply(rule conjunctionI, rule)
❴ premises _ and A[THEN dabc_equation_D_main] and _ and _ and _ and _ and _ and _ and Tr
note A[THEN conjunct1, symmetric, simp]
A[THEN conjunct2, simp] ;
unfold ‹b' = b›
unfold ‹c' = c› ;
apply_rule ToA_Mapper_backward[OF Tr, where x=‹case x of (y,r,x⇩c) ⇒ (y,r)›]
certified by (insert useful(1), clarsimp split: prod.split simp add: φ image_iff,
case_tac ‹uz b c (z d a (ba, aa))›, clarsimp,
case_tac ‹h (ac,aaa)›, clarsimp, force) ;
apply_rule apply_Module_Distr_Homo⇩Z[where s=b and t=c and F=F⇩1' and x=‹case x of (y,r,x⇩c) ⇒ case s (y,r) of (x⇩b,w) ⇒ (x⇩b,x⇩c)›]
certified apply (insert useful(1), simp add: image_iff del: split_paired_All, elim bexE)
subgoal premises prems for y
by (insert prems(2) useful(2)[THEN bspec[OF _ prems(1)]]
ToA_Mapper_f_expn[OF Tr, simplified, THEN bspec[OF _ prems(1)], symmetric],
clarsimp simp add: prod.rotL_def useful(3-) split: prod.split) . ;
apply_rule apply_Module_Distr_Homo⇩S[where s=d and t=a and F=F⇩1' and x=‹case x of (y,r,x⇩c) ⇒ case s (y,r) of (x⇩b,w) ⇒ z' b c (x⇩b,x⇩c)›]
certified apply (insert useful(1), simp add: image_iff del: split_paired_All, elim bexE)
subgoal premises prems for y
by (insert prems(2) useful(2)[THEN bspec[OF _ prems(1)]]
ToA_Mapper_f_expn[OF Tr, simplified, THEN bspec[OF _ prems(1)], symmetric],
clarsimp simp add: prod.rotL_def useful(3-) split: prod.split) . ;;
fold ‹a' = a›
❵ certified by (clarsimp split: prod.split simp add: the_φ(16))
apply (rule conjunctionI, rule, unfold Premise_def conj_imp_eq_imp_imp, rule ballI)
subgoal premises prems for x proof -
thm prems
show ?thesis
by (insert ToA_Mapper_f_expn_rev[OF ‹𝗆𝖺𝗉 g ⊗⇩f r : _ ↦ _ 𝗈𝗏𝖾𝗋 f⇩b ⊗⇩f w : _ ↦ _ 𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s 𝗂𝗇 _›,
simplified, THEN bspec[OF _ ‹x ∈ D›]]
‹separatable_module_zip _ _ _ _ _ _ _ _ _ _ _ _ _ _›
[unfolded separatable_module_zip_def, THEN spec[where x=‹case x of (x⇩a,w,x⇩d) ⇒ (x⇩d,x⇩a)›]],
clarsimp split: prod.split simp: ‹dabc_equation d a b c› ‹a' = a› ‹b' = b› ‹c' = c›,
insert prems(17) prems(20), fastforce)
qed .
lemma SE_Module_SDistr_ad_cb_ToA_mapper
[φreason_template default %φmapToA_derived_module_SDistri
name F⇩1.module_mapper⇩a⇩d⇩_⇩c⇩b
pass: phi_TA_Module_Distrib_rule_pass_no_comm_scalar]:
‹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 a' = a ∧ b' = b ∧ c' = c
⟹ NO_SIMP (𝗀𝗎𝖺𝗋𝖽 dabc_equation c b a d)
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩S F⇩1 Ds Dx⇩u uz
⟹ Type_Variant_of_the_Same_Scalar_Mul⇩0 F⇩1 F⇩3
⟹ Type_Variant_of_the_Same_Scalar_Mul⇩0 F⇩1 F⇩1'
⟹ Type_Variant_of_the_Same_Scalar_Mul⇩0 F⇩3 F⇩3'
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩Z F⇩1 Ds Dx⇩z z
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩S F⇩1' Ds' Dx⇩u' uz'
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩Z F⇩1' Ds' Dx⇩z' z'
⟹ NO_MATCH (a''::'s'::partial_ab_semigroup_add) a @tag 𝒜_template_reason None
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ds a ∧ Ds d ∧ Ds c ∧ Ds b ∧ Ds' c ∧ Ds' b ∧ Ds' a ∧ Ds' d
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀x∈D. let (x⇩a,w,x⇩d) = x
; (x⇩c,x⇩b) = uz c b (z a d (x⇩a,x⇩d))
in D⇩s⇩z (x⇩a,x⇩d) (f⇩c x⇩c, f x⇩b) ∧
Dx⇩z a d (x⇩a,x⇩d) ∧
Dx⇩u c b (z a d (x⇩a,x⇩d)) ∧
Dx⇩z' c b (f⇩c x⇩c, f x⇩b) ∧
Dx⇩u' a d (z' c b (f⇩c x⇩c, f x⇩b)) )
⟹ 𝗆𝖺𝗉 g ⊗⇩f r : F⇩3 b ✼ R ↦ F⇩3' b ✼ R'
𝗈𝗏𝖾𝗋 f ⊗⇩f w : F⇩1 b ✼ W ↦ F⇩1' b ✼ W'
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s
𝗂𝗇 (λ(x⇩a,w,x⇩d). let (x⇩c,x⇩b) = uz c b (z a d (x⇩a,x⇩d)) in (x⇩b,w)) ` D
⟹ separatable_module_zip False a d c b uz' z' uz z D⇩s⇩z f⇩c f f' f⇩d @tag 𝒜_template_reason undefined
⟹ 𝗆𝖺𝗉 g ⊗⇩f (r ⊗⇩f f⇩c) : F⇩3 b ✼ R ∗ F⇩1 c ↦ F⇩3' b' ✼ R' ∗ F⇩1' c'
𝗈𝗏𝖾𝗋 f' ⊗⇩f w ⊗⇩f f⇩d : F⇩1 a ✼ W ∗ F⇩1 d ↦ F⇩1' a' ✼ W' ∗ F⇩1' d
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 SIMP (λ(x⇩a,w,x⇩d). let (x⇩c,x⇩b) = uz c b (z a d (x⇩a,x⇩d))
; (y,r) = h (x⇩b,w)
in (y,r,x⇩c))
𝗌𝖾𝗍𝗍𝖾𝗋 SIMP (λ(y,r,x⇩c). let (x⇩b,w) = s (y,r)
; (x⇩a,x⇩d) = uz' a d (z' c b (x⇩c,x⇩b))
in (x⇩a,w,x⇩d))
𝗂𝗇 D ›
for F⇩1 :: ‹'s::partial_add_magma ⇒ ('c::sep_algebra, 'a) φ›
unfolding Action_Tag_def 𝗋Guard_def NO_SIMP_def SIMP_def
Type_Variant_of_the_Same_Scalar_Mul⇩0_def φProd'_def
apply simp
❴ premises _ and dabc[THEN dabc_equation_D_main] and _ and _ and _ and _ and _ and _ and Tr and _
note dabc[THEN conjunct1, symmetric, simp]
dabc[THEN conjunct2, simp] ;
apply_rule apply_Module_Distr_Homo⇩Z[where s=a and t=d and F=F⇩1]
certified by (instantiate ‹(fst x, snd (snd x))›, clarsimp split: prod.split simp add: useful, insert useful(1,2), force) ;;
apply_rule apply_Module_Distr_Homo⇩S[where t=b and s=c and F=F⇩1]
apply_rule ToA_Mapper_onward[OF Tr, where x=‹case x of (x⇩a,w,x⇩d) ⇒ case uz c b (z a d (x⇩a,x⇩d)) of (x⇩c,x⇩b) ⇒ (x⇩b,w)›]
certified by (clarsimp split: prod.split simp add: useful)
❵ certified by (clarsimp split: prod.split simp add: useful)
apply(rule conjunctionI, rule)
❴ premises _ and dabc[THEN dabc_equation_D_main, simp] and _ and _ and _ and _ and _ and _ and Tr
unfold ‹b' = b›
unfold ‹c' = c›
apply_rule ToA_Mapper_backward[OF Tr, where x=‹case x of (y,r,x⇩c) ⇒ (y,r)›]
certified apply (clarsimp simp add: image_iff useful split: prod.split,
insert useful(1), clarsimp simp add: image_iff split: prod.split)
subgoal premises prems for x1 aa ba ab ac bb
by (rule bexI[OF _ prems(2)], insert prems(1,3), clarsimp, case_tac ‹h (x2, ac)›, clarsimp) . ;
apply_rule apply_Module_Distr_Homo⇩Z[where s=c and t=b and F=F⇩1' and x=‹case x of (y,r,x⇩c) ⇒ case s (y,r) of (x⇩b,w) ⇒ (x⇩c,x⇩b)›]
certified apply (insert useful(1)[simplified image_image], simp add: image_iff del: split_paired_All, elim bexE)
subgoal premises prems for y
by (insert prems(2) useful(2)[THEN bspec[OF _ prems(1)]]
ToA_Mapper_f_expn[OF Tr, simplified, THEN bspec[OF _ prems(1)], symmetric],
clarsimp simp add: useful(4-) split: prod.split) . ;
apply_rule apply_Module_Distr_Homo⇩S[where s=a and t=d and F=F⇩1' and x=‹case x of (y,r,x⇩c) ⇒ case s (y,r) of (x⇩b,w) ⇒ z' c b (x⇩c,x⇩b)›]
certified apply (insert useful(1)[simplified image_image], simp add: image_iff del: split_paired_All, elim bexE)
subgoal premises prems for y
by (insert prems(2) useful(2)[THEN bspec[OF _ prems(1)]]
ToA_Mapper_f_expn[OF Tr, simplified, THEN bspec[OF _ prems(1)], symmetric],
clarsimp simp add: useful(3-) split: prod.split) . ;;
fold ‹a' = a›
❵ certified by (clarsimp split: prod.split simp add: the_φ(16))
apply (rule conjunctionI, rule, unfold Premise_def conj_imp_eq_imp_imp, rule ballI)
subgoal premises prems for x proof -
show ?thesis
by (insert ToA_Mapper_f_expn_rev[OF ‹𝗆𝖺𝗉 g ⊗⇩f r : _ ↦ _ 𝗈𝗏𝖾𝗋 f ⊗⇩f w : _ ↦ _ 𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s 𝗂𝗇 _›,
simplified, THEN bspec[OF _ ‹x ∈ D›]]
‹separatable_module_zip _ _ _ _ _ _ _ _ _ _ _ _ _ _›[unfolded separatable_module_zip_def, THEN spec[where x=‹case x of (x⇩a,w,x⇩d) ⇒ (x⇩a,x⇩d)›]],
clarsimp split: prod.split simp: ‹dabc_equation c b a d› ‹a' = a› ‹b' = b› ‹c' = c›,
insert prems(17) prems(20), fastforce)
qed .
lemma SE_Module_SDistr_a_dbc_ToA_mapper
[φreason_template default %φmapToA_derived_module_SDistri
name: F⇩1.module_mapper⇩a⇩_⇩d⇩b⇩c
pass: phi_TA_Module_Distrib_rule_pass_no_comm_scalar]:
‹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 a' = a ∧ b' = b
⟹ NO_SIMP (𝗀𝗎𝖺𝗋𝖽 equation⇩3⇩1_cond C⇩d C⇩c d b db c a)
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩S F⇩1 Ds Dx uz
⟹ Type_Variant_of_the_Same_Scalar_Mul⇩0 F⇩1 F⇩3
⟹ Type_Variant_of_the_Same_Scalar_Mul⇩0 F⇩1 F⇩1'
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩Z F⇩1' Ds' Dx⇩z z
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (C⇩c ⟶ Ds c ∧ Ds db ∧ Ds' db ∧ Ds' c) ∧
(C⇩d ⟶ Ds d ∧ Ds b ∧ Ds' d ∧ Ds' b )
⟹ NO_SIMP (module_mapper⇩3⇩1⇩C C⇩c C⇩d c b db d uz z Dx Dx⇩z D⇩G f⇩c f f⇩d f' getter)
⟹ 𝗆𝖺𝗉 g ⊗⇩f r : F⇩3 b ✼ R⇩G ↦ F⇩3' b ✼ R⇩G'
𝗈𝗏𝖾𝗋 f ⊗⇩f w : F⇩1 b ✼ W ↦ F⇩1' b ✼ W'
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s
𝗂𝗇 (λ(x,w). case getter x of (x⇩d, x⇩b, x⇩c) ⇒ (x⇩b, w)) ` D
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀x∈D. D⇩G (fst x))
⟹ 𝗆𝖺𝗉 g ⊗⇩f r ⊗⇩f f⇩d ⊗⇩f f⇩c : F⇩3 b ✼ R⇩G ∗ ◒[C⇩d] F⇩1 d ∗ ◒[C⇩c] F⇩1 c ↦ F⇩3' b' ✼ R⇩G' ∗ ◒[C⇩d] F⇩1' d ∗ ◒[C⇩c] F⇩1' c
𝗈𝗏𝖾𝗋 f' ⊗⇩f w : F⇩1 a ✼ W ↦ F⇩1' a' ✼ W'
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 SIMP (λ(x,w). let (x⇩d, x⇩b, x⇩c) = getter x
; (y,r) = h (x⇩b, w)
in (y, r, x⇩d, x⇩c))
𝗌𝖾𝗍𝗍𝖾𝗋 SIMP (λ(y,r,x⇩d,x⇩c). case s (y,r) of (x⇩b,w) ⇒
(?⇩j⇩R C⇩c (z db c) (?⇩j⇩L C⇩d (z d b) (x⇩d,x⇩b), x⇩c), w))
𝗂𝗇 D ›
for F⇩1 :: ‹'s::partial_add_magma ⇒ ('c::sep_algebra, 'a) φ›
unfolding Action_Tag_def 𝗋Guard_def NO_SIMP_def module_mapper⇩3⇩1⇩C_def
Type_Variant_of_the_Same_Scalar_Mul⇩0_def φProd'_def
apply simp
❴ premises _ and EC[unfolded equation⇩3⇩1_cond_def, simplified, simp] and SS[] and SZ[] and _
and MG and Tr[] and D⇩G and Dom[useful]
note D⇩G' = D⇩G[THEN bspec[OF _ Dom]]
note t1[useful] = MG[THEN spec, THEN mp, OF D⇩G'] ;
apply_rule apply_Module_Distr_Homo⇩S_RCond[OF SS, where s=‹db› and t=c and C=C⇩c]
apply_rule apply_Module_Distr_Homo⇩S_LCond[OF SS, where s=‹d› and t=b and C=C⇩d]
apply_rule ToA_Mapper_onward[OF Tr,
where x=‹case x of (x,w) ⇒ case ?⇩s⇩R C⇩c (uz db c) x of (x⇩d⇩b, x⇩c) ⇒ case ?⇩s⇩L C⇩d (uz d b) x⇩d⇩b of (x⇩d, x⇩b) ⇒ (x⇩b, w)›]
certified by (insert t1, clarsimp split: prod.split simp: image_iff, metis Dom fst_conv snd_conv)
❵ certified by (insert t1, clarsimp simp add: image_iff split: prod.split)
apply (rule conjunctionI, rule)
❴ premises _ and EC[unfolded equation⇩3⇩1_cond_def, simplified, simp] and SS[] and SZ[] and _
and MG and Tr[] and D⇩G and Dom'
from Dom'
obtain y where Dom[useful]: ‹y ∈ D›
and x_def[simp]: ‹x = (g ⊗⇩f r ⊗⇩f f⇩d ⊗⇩f f⇩c) (case y of (x, w) ⇒
case getter x of (x⇩d, x⇩b, x⇩c) ⇒ case h (x⇩b, w) of (y, r) ⇒ (y, r, x⇩d, x⇩c))›
by (clarsimp simp add: split_beta)
note D⇩G' = D⇩G[THEN bspec[OF _ Dom]]
note t1[useful] = MG[THEN spec, THEN mp, OF D⇩G', THEN mp, OF EC[THEN conjunct2]] ;;
unfold ‹b' = b›
apply_rule ToA_Mapper_backward[OF Tr, where x=‹apsnd fst x›]
certified by (insert t1 Dom, clarsimp simp add: image_iff split: prod.split, force) ; ;
apply_rule apply_Module_Distr_Homo⇩Z_LCond_φSome[OF SZ, where s=‹d› and t=b and r=db and C=C⇩d
and x=‹case x of (y,r,x⇩d,x⇩c) ⇒ case s (y,r) of (x⇩b,w) ⇒ (x⇩d,x⇩b)›]
certified by (insert useful(1) the_φ(6) ToA_Mapper_f_expn_rev[OF Tr],
clarsimp simp add: image_iff ‹C⇩d ⟶ _ ∧ _› split: prod.split,
fastforce) ;
apply_rule apply_Module_Distr_Homo⇩Z_RCond_φSome[OF SZ, where s=‹db› and t=c and r=a and C=C⇩c
and x=‹case x of (y,r,x⇩d,x⇩c) ⇒ case s (y,r) of (x⇩b,w) ⇒ (?⇩j⇩L C⇩d (z d b) (x⇩d,x⇩b), x⇩c)›]
certified by (insert t1 Dom ToA_Mapper_f_expn_rev[OF Tr, simplified, THEN bspec[OF _ Dom]],
clarsimp simp add: image_iff split: prod.split, auto_sledgehammer) ;;
fold ‹a' = a›
❵ certified by (clarsimp split: prod.split)
apply (rule conjunctionI, rule, unfold Premise_def conj_imp_eq_imp_imp, rule ballI)
subgoal premises prems for x proof -
show ?thesis
by (insert ToA_Mapper_f_expn_rev[OF ‹𝗆𝖺𝗉 g ⊗⇩f r : _ ↦ _ 𝗈𝗏𝖾𝗋 f ⊗⇩f w : _ ↦ _ 𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s 𝗂𝗇 _›,
simplified, THEN bspec[OF _ ‹x ∈ D›]]
‹∀x. D⇩G x ⟶ _› [THEN spec[where x=‹fst x›]],
clarsimp split: prod.split, auto_sledgehammer)
qed .
lemma SE_Module_SDistr_a_dεc_ToA_mapper
[φreason_template default %φmapToA_derived_module_SDistri
name: F⇩1.module_mapper⇩a⇩_⇩d⇩ε⇩c
pass: phi_TA_Module_Distrib_rule_pass_no_comm_scalar]:
‹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 a' = a
⟹ NO_SIMP (𝗀𝗎𝖺𝗋𝖽 equation⇩3⇩1_cond C⇩d C⇩c d ε dε c a )
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩S F⇩1 Ds Dx uz
⟹ Type_Variant_of_the_Same_Scalar_Mul⇩0 F⇩1 F⇩3
⟹ Type_Variant_of_the_Same_Scalar_Mul⇩0 F⇩1 F⇩1'
⟹ Type_Variant_of_the_Same_Scalar_Mul⇩0 F⇩1 F⇩3'
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩Z F⇩1' Ds' Dx⇩z z
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩E F⇩1 U ε D⇩ε⇩E E⇩ε Any_P⇩E
⟹ TERM Module_One⇩I F⇩3 T ε D⇩ε⇩I⇩T I⇩ε⇩T Any_P⇩I⇩T
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_One⇩I F⇩1' U' ε D⇩ε⇩I I⇩ε Any_P⇩I
⟹ TERM Module_One⇩E F⇩3' T' ε D⇩ε⇩E⇩T E⇩ε⇩T Any_P⇩E⇩T
⟹ NO_MATCH (a''::'s'::partial_ab_semigroup_add) a @tag 𝒜_template_reason None
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (C⇩c ⟶ Ds c ∧ Ds dε ∧ Ds' dε ∧ Ds' c) ∧
(C⇩d ⟶ Ds d ∧ Ds ε ∧ Ds' d ∧ Ds' ε)
⟹ NO_SIMP (module_mapper⇩3⇩ε⇩C C⇩c C⇩d c ε dε d uz z E⇩ε I⇩ε D⇩ε⇩E D⇩ε⇩I Dx Dx⇩z D⇩G f⇩c f f⇩d f' getter)
⟹ 𝗆𝖺𝗉 g ⊗⇩f r : T ✼ R⇩G ↦ T' ✼ R⇩G'
𝗈𝗏𝖾𝗋 f ⊗⇩f w : U ✼ W ↦ U' ✼ W'
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s
𝗂𝗇 (λ(x,w). case getter x of (x⇩d, x⇩b, x⇩c) ⇒ (x⇩b, w)) ` D
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀x∈D. D⇩G (fst x))
⟹ 𝗆𝖺𝗉 g ⊗⇩f r ⊗⇩f f⇩d ⊗⇩f f⇩c : T ✼ R⇩G ∗ ◒[C⇩d] F⇩1 d ∗ ◒[C⇩c] F⇩1 c ↦ T' ✼ R⇩G' ∗ ◒[C⇩d] F⇩1' d ∗ ◒[C⇩c] F⇩1' c
𝗈𝗏𝖾𝗋 f' ⊗⇩f w : F⇩1 a ✼ W ↦ F⇩1' a' ✼ W'
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 SIMP (λ(x,w). let (x⇩d, x⇩b, x⇩c) = getter x
; (y,r) = h (x⇩b, w)
in (y, r, x⇩d, x⇩c))
𝗌𝖾𝗍𝗍𝖾𝗋 SIMP (λ(y,r,x⇩d,x⇩c). case s (y,r) of (x⇩b,w) ⇒
(?⇩j⇩R C⇩c (z dε c) (?⇩j⇩L C⇩d (z d ε) (x⇩d, I⇩ε x⇩b), x⇩c), w))
𝗂𝗇 D ›
for F⇩1 :: ‹'s::partial_add_magma ⇒ ('c::sep_algebra, 'a) φ›
unfolding Action_Tag_def 𝗋Guard_def NO_SIMP_def φProd'_def
Type_Variant_of_the_Same_Scalar_Mul⇩0_def module_mapper⇩3⇩ε⇩C_def
apply simp
❴ premises _ and EC[unfolded equation⇩3⇩1_cond_def, simp] and SS[] and SZ[] and S1⇩E[] and [] and S1⇩I[] and [] and _
and MG and Tr[] and D⇩G[] and Dom[useful]
note D⇩G' = D⇩G[THEN bspec[OF _ Dom]]
from EC have db: ‹?⇩+ True dε = ?⇩+ C⇩d d + ?⇩+ True ε ∧ (C⇩c ⟶ dε ##⇩+ c) ∧ (C⇩d ⟶ d ##⇩+ ε)› by blast
note t1[useful] = MG[THEN spec, THEN mp, OF D⇩G', THEN mp, OF db] ;
apply_rule apply_Module_Distr_Homo⇩S_RCond[OF SS, where s=‹dε› and t=c and C=C⇩c]
apply_rule apply_Module_Distr_Homo⇩S_LCond[OF SS, where s=‹d› and t=ε and C=C⇩d]
apply_rule apply_Module_One⇩E[OF S1⇩E] ;
apply_rule ToA_Mapper_onward[OF Tr,
where x=‹case x of (x,w) ⇒ case getter x of (x⇩d, x⇩b, x⇩c) ⇒ (x⇩b, w)›]
certified by (insert t1 Dom, clarsimp split: prod.split simp: image_iff Let_def, auto_sledgehammer)
❵ certified by (insert t1 Dom, clarsimp split: prod.split simp: image_iff Let_def, auto_sledgehammer)
apply (rule conjunctionI, rule)
❴ premises _ and EC[unfolded equation⇩3⇩1_cond_def, simp] and SS[] and SZ[] and S1⇩E[] and [] and S1⇩I[] and [] and _
and MG and Tr[] and D⇩G[] and Dom'[]
from Dom'
obtain y where Dom[useful]: ‹y ∈ D›
and x_def[simp]: ‹x = (g ⊗⇩f r ⊗⇩f f⇩d ⊗⇩f f⇩c) (
case y of (x, w) ⇒ case getter x of (x⇩d, x⇩b, x⇩c) ⇒ case h (x⇩b, w) of (y, r) ⇒ (y, r, x⇩d, x⇩c))›
by (clarsimp simp add: split_beta)
note D⇩G' = D⇩G[THEN bspec[OF _ Dom]]
from EC have db: ‹?⇩+ True dε = ?⇩+ C⇩d d + ?⇩+ True ε ∧ (C⇩c ⟶ dε ##⇩+ c) ∧ (C⇩d ⟶ d ##⇩+ ε)› by blast
note t1[useful] = MG[THEN spec, THEN mp, OF D⇩G', THEN mp, OF db] ;;
apply_rule ToA_Mapper_backward[OF Tr, where x=‹apsnd fst x›]
certified by (insert t1 Dom, clarsimp simp add: image_iff split: prod.split, force) ;;
apply_rule apply_Module_One⇩I[OF S1⇩I]
certified by (insert t1 Dom ToA_Mapper_f_expn_rev[OF Tr, simplified Ball_image_comp, THEN bspec[OF _ Dom]],
clarsimp simp add: image_iff split: prod.split) ;;
apply_rule apply_Module_Distr_Homo⇩Z_LCond_φSome[OF SZ, where s=‹d› and t=ε and r=dε and C=C⇩d
and x=‹case x of (y,r,x⇩d,x⇩c) ⇒ case s (y,r) of (x⇩b,w) ⇒ (x⇩d, I⇩ε x⇩b)›]
certified by (insert t1 Dom ToA_Mapper_f_expn_rev[OF Tr, simplified Ball_image_comp, THEN bspec[OF _ Dom]],
clarsimp simp add: image_iff split: prod.split, auto_sledgehammer) ;;
apply_rule apply_Module_Distr_Homo⇩Z_RCond_φSome[OF SZ, where s=‹dε› and t=c and r=a and C=C⇩c
and x=‹case x of (y,r,x⇩d,x⇩c) ⇒ case s (y,r) of (x⇩b,w) ⇒ (?⇩j⇩L C⇩d (z d ε) (x⇩d,I⇩ε x⇩b), x⇩c)›]
certified by (insert t1 Dom ToA_Mapper_f_expn_rev[OF Tr, simplified Ball_image_comp, THEN bspec[OF _ Dom]],
clarsimp simp add: image_iff split: prod.split, auto_sledgehammer) ;;
fold ‹a' = a›
❵ certified by (clarsimp split: prod.split)
apply (rule conjunctionI, rule, unfold Premise_def conj_imp_eq_imp_imp, rule ballI)
subgoal premises prems for x proof -
show ?thesis
by (insert ToA_Mapper_f_expn_rev[OF ‹𝗆𝖺𝗉 g ⊗⇩f r : _ ↦ _ 𝗈𝗏𝖾𝗋 f ⊗⇩f w : _ ↦ _ 𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s 𝗂𝗇 _›,
simplified, THEN bspec[OF _ ‹x ∈ D›]]
‹∀x. D⇩G x ⟶ _› [THEN spec[where x=‹fst x›]],
clarsimp split: prod.split, auto_sledgehammer)
qed .
lemma SE_Module_SDistr_dac_b_ToA_mapper
[φreason_template default %φmapToA_derived_module_SDistri name: F⇩1.module_mapper⇩d⇩a⇩c⇩_⇩b]:
‹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 a' = a ∧ b' = b
⟹ NO_SIMP (𝗀𝗎𝖺𝗋𝖽 equation⇩3⇩1_cond C⇩d C⇩c d a da c b)
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩Z F⇩1 Ds Dx z
⟹ Type_Variant_of_the_Same_Scalar_Mul⇩0 F⇩1 F⇩3
⟹ Type_Variant_of_the_Same_Scalar_Mul⇩0 F⇩1 F⇩1'
⟹ 𝗀𝗎𝖺𝗋𝖽 Module_Distr_Homo⇩S F⇩1' Ds' Dx⇩S uz
⟹ NO_MATCH (a''::'s'::partial_ab_semigroup_add) a @tag 𝒜_template_reason None
⟹ 𝗀𝗎𝖺𝗋𝖽 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (C⇩d ⟶ Ds d ∧ Ds a ∧ Ds' d ∧ Ds' a) ∧
(C⇩c ⟶ Ds da ∧ Ds c ∧ Ds' da ∧ Ds' c)
⟹ module_mapper⇩1⇩3⇩C C⇩c C⇩d d a da c uz z Dx⇩S Dx D⇩G f⇩d f⇩a f⇩c f getter
⟹ 𝗆𝖺𝗉 g ⊗⇩f r : F⇩3 b ✼ R ↦ F⇩3' b ✼ R'
𝗈𝗏𝖾𝗋 f ⊗⇩f w : F⇩1 b ✼ W⇩G ↦ F⇩1' b ✼ W⇩G'
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s
𝗂𝗇 (λ(x⇩a,x⇩d,x⇩c,w). (getter (x⇩a,x⇩d,x⇩c), w)) ` D
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀(x⇩a,x⇩d,x⇩c,w)∈D. D⇩G (x⇩a,x⇩d,x⇩c))
⟹ 𝗆𝖺𝗉 g ⊗⇩f r : F⇩3 b ✼ R ↦ F⇩3' b' ✼ R'
𝗈𝗏𝖾𝗋 f⇩a ⊗⇩f f⇩d ⊗⇩f f⇩c ⊗⇩f w : F⇩1 a' ✼ ◒[C⇩d] F⇩1 d ∗ ◒[C⇩c] F⇩1 c ∗ W⇩G ↦ F⇩1' a' ✼ ◒[C⇩d] F⇩1' d ∗ ◒[C⇩c] F⇩1' c ∗ W⇩G'
𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 SIMP (λ(x⇩a,x⇩d,x⇩c,w). h (getter (x⇩a,x⇩d,x⇩c), w))
𝗌𝖾𝗍𝗍𝖾𝗋 SIMP (λyr. let (x⇩b,w) = s yr
; (x⇩d⇩a,x⇩c) = ?⇩s⇩R C⇩c (uz da c) x⇩b
; (x⇩d,x⇩a) = ?⇩s⇩L C⇩d (uz d a) x⇩d⇩a
in (x⇩a,x⇩d,x⇩c,w))
𝗂𝗇 D ›
for F⇩1 :: ‹'s::partial_add_magma ⇒ ('c::sep_algebra, 'a) φ›
unfolding Action_Tag_def 𝗋Guard_def NO_SIMP_def Type_Variant_of_the_Same_Scalar_Mul⇩0_def φProd'_def
apply simp
❴ premises [simp] and EC[unfolded equation⇩3⇩1_cond_def, simp] and SZ[] and [] and [simp]
and MG and Tr[] and D⇩G[] and Dom
from D⇩G[THEN bspec[OF _ Dom]]
have D⇩G': ‹D⇩G (case x of (x⇩a, x⇩d, x⇩c, w) ⇒ (x⇩a, x⇩d, x⇩c))› by (cases x; clarsimp)
note t1[useful] = MG[unfolded module_mapper⇩1⇩3⇩C_def, THEN spec, THEN mp, OF D⇩G', THEN mp, OF EC[THEN conjunct2]] ;;
apply_rule apply_Module_Distr_Homo⇩Z_LCond_φSome[OF SZ, where s=d and t=a and r=da and C=C⇩d
and x=‹case x of (x⇩a,x⇩d,x⇩c,w) ⇒ (x⇩d,x⇩a)›]
certified by (insert t1 Dom, clarsimp split: prod.split) ;;
apply_rule apply_Module_Distr_Homo⇩Z_RCond_φSome[OF SZ, where s=da and t=c and r=b and C=C⇩c
and x=‹case x of (x⇩a,x⇩d,x⇩c,w) ⇒ (?⇩j⇩L C⇩d (z d a) (x⇩d,x⇩a), x⇩c)›]
certified by (insert t1 Dom, clarsimp split: prod.split) ;;
apply_rule ToA_Mapper_onward[OF Tr, where x=‹case x of (x⇩a,x⇩d,x⇩c,w) ⇒ (?⇩j⇩R C⇩c (z da c) (?⇩j⇩L C⇩d (z d a) (x⇩d,x⇩a), x⇩c), w)›]
certified by (insert t1 Dom, clarsimp split: prod.split simp: image_iff, auto_sledgehammer)
❵ certified by (insert t1 Dom, clarsimp split: prod.split simp: image_iff)
apply (rule conjunctionI, rule)
❴ premises _ and EC[unfolded equation⇩3⇩1_cond_def, simp] and SZ[] and SS[] and B
and MG and Tr[] and D⇩G[] and Dom'[]
from Dom'
obtain y where Dom[useful]: ‹y ∈ D›
and x_def[simp]: ‹x = (g ⊗⇩f r) (case y of (x⇩a, x⇩d, x⇩c, w) ⇒ h (getter (x⇩a, x⇩d, x⇩c), w))›
by (clarsimp, metis map_prod_simp)
from D⇩G[THEN bspec[OF _ Dom]]
have D⇩G': ‹D⇩G (case y of (x⇩a, x⇩d, x⇩c, w) ⇒ (x⇩a, x⇩d, x⇩c))› by (cases x; clarsimp)
note t1[useful] = MG[unfolded module_mapper⇩1⇩3⇩C_def, THEN spec, THEN mp, OF D⇩G', THEN mp, OF EC[THEN conjunct2]] ;;
unfold ‹b' = b›
apply_rule ToA_Mapper_backward[OF Tr, where x=x]
certified by (insert t1 Dom, clarsimp split: prod.split simp: image_iff, force) ;
apply_rule apply_Module_Distr_Homo⇩S_RCond[OF SS, where x=‹(fst o s) x› and s=da and t=c and r=b and C=C⇩c]
certified by (insert t1 Dom ToA_Mapper_f_expn_rev[OF Tr, simplified Ball_image_comp, THEN bspec[OF _ Dom]],
clarsimp split: prod.split simp: image_iff B) ;
apply_rule apply_Module_Distr_Homo⇩S_LCond[OF SS, where s=d and t=a and r=da and C=C⇩d and x=‹(fst o ?⇩s⇩R C⇩c (uz da c) o fst o s) x›]
certified by (insert t1 Dom ToA_Mapper_f_expn_rev[OF Tr, simplified Ball_image_comp, THEN bspec[OF _ Dom]],
clarsimp split: prod.split simp: image_iff B) ;;
fold ‹a' = a›
❵ certified by (clarsimp split: prod.split simp: prod.map_beta the_φ(10))
apply (rule conjunctionI, rule, rule, unfold Premise_def conj_imp_eq_imp_imp module_mapper⇩1⇩3⇩C_def)
subgoal premises prems for x proof -
from ‹∀(x⇩a, x⇩d, x⇩c, w)∈D. D⇩G (x⇩a, x⇩d, x⇩c)›[THEN bspec[OF _ ‹x ∈ D›]]
have D⇩G': ‹D⇩G (case x of (x⇩a, x⇩d, x⇩c, w) ⇒ (x⇩a, x⇩d, x⇩c))› by (cases x; clarsimp)
show ?thesis
by (insert ToA_Mapper_f_expn_rev[OF ‹𝗆𝖺𝗉 g ⊗⇩f r : _ ↦ _ 𝗈𝗏𝖾𝗋 f ⊗⇩f w : _ ↦ _ 𝗐𝗂𝗍𝗁 𝗀𝖾𝗍𝗍𝖾𝗋 h 𝗌𝖾𝗍𝗍𝖾𝗋 s 𝗂𝗇 _›,
simplified, THEN bspec[OF _ ‹x ∈ D›]]
‹∀x. D⇩G x ⟶ _›[THEN spec, THEN mp, OF D⇩G'],
cases x, clarsimp split: prod.split,
case_tac ‹?⇩s⇩R C⇩c (uz da c) (f (?⇩j⇩R C⇩c (z da c) (?⇩j⇩L C⇩d (z d a) (b, aa), ca)))›, clarsimp,
case_tac ‹?⇩s⇩L C⇩d (uz d a) x1›, clarsimp,
insert equation⇩3⇩1_cond_def prems(3), fastforce)
qed .
end
subsection ‹Commutativity between φ-Type Operators›
paragraph ‹Deriving Rewrites›
subparagraph ‹1-to-1›
lemma Comm_Tyops_Rewr_temlpate[φreason_template name F.G.rewr[]]:
‹ Tyops_Commute F F' G G' T D (embedded_func f P)
⟹ Tyops_Commute G' G F' F T D' (embedded_func g Q)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (g (f x) = x) ∧ D x ∧ D' (f x)
⟹ (x ⦂ F (G T)) = (f x ⦂ G' (F' T)) ›
unfolding Tyops_Commute_def Premise_def Transformation_def BI_eq_iff
by clarsimp metis
lemma Comm_Tyops_Rewr⇩2_temlpate[φreason_template name F.G.rewr[]]:
‹ Tyops_Commute⇩1⇩_⇩2 F F'⇩T F'⇩U G G' T U D (embedded_func f P)
⟹ Tyops_Commute⇩2⇩_⇩1 F F'⇩T F'⇩U G G' T U D' (embedded_func g Q)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 g (f x) = x ∧ D x ∧ D' (f x)
⟹ (x ⦂ F (G T U)) = (f x ⦂ G' (F'⇩T T) (F'⇩U U)) ›
unfolding BI_eq_iff Premise_def Tyops_Commute⇩1⇩_⇩2_def Tyops_Commute⇩2⇩_⇩1_def Transformation_def
by clarsimp metis
subparagraph ‹1-to-1λ›
lemma [φreason_template name F.G.rewr[]]:
‹ Tyops_Commute⇩Λ⇩I F F' G G' T D (embedded_func f P)
⟹ Tyops_Commute⇩Λ⇩E G' G F' F T D' (embedded_func g Q)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x ∧ D' (f x) ∧ g (f x) = x
⟹ (x ⦂ F (G T)) = (f x ⦂ G' (λp. F' (T p))) ›
unfolding Tyops_Commute⇩Λ⇩I_def Tyops_Commute⇩Λ⇩E_def Transformation_def Premise_def BI_eq_iff
by clarsimp metis
lemma [φreason_template name F.G.rewr[]]:
‹ Tyops_Commute⇩Λ⇩E F F' G G' T D (embedded_func f P)
⟹ Tyops_Commute⇩Λ⇩I G' G F' F T D' (embedded_func g Q)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x ∧ D' (f x) ∧ g (f x) = x
⟹ (x ⦂ F (λp. G (T p))) = (f x ⦂ G' (F' T)) ›
unfolding Tyops_Commute⇩Λ⇩I_def Tyops_Commute⇩Λ⇩E_def Transformation_def Premise_def BI_eq_iff
by clarsimp metis
subparagraph ‹1-to-2›
lemma [φreason_template name F.G.rewr[]]:
‹ Tyops_Commute⇩1⇩_⇩2 F F'⇩T F'⇩U G G' T U D (embedded_func f P)
⟹ Tyops_Commute⇩2⇩_⇩1 F F'⇩T F'⇩U G G' T U D' (embedded_func g Q)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x ∧ D' (f x) ∧ g (f x) = x
⟹ (x ⦂ F (G T U)) = (f x ⦂ G' (F'⇩T T) (F'⇩U U)) ›
unfolding Tyops_Commute⇩2⇩_⇩1_def Tyops_Commute⇩1⇩_⇩2_def Premise_def Transformation_def
BI_eq_iff
by clarsimp metis
lemma [φreason_template name G'.F.rewr[]]:
‹ Tyops_Commute⇩1⇩_⇩2 F F'⇩T F'⇩U G G' T U D (embedded_func f P)
⟹ Tyops_Commute⇩2⇩_⇩1 F F'⇩T F'⇩U G G' T U D' (embedded_func g Q)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D (g x) ∧ D' x ∧ f (g x) = x
⟹ (x ⦂ G' (F'⇩T T) (F'⇩U U)) = (g x ⦂ F (G T U)) ›
unfolding Tyops_Commute⇩2⇩_⇩1_def Tyops_Commute⇩1⇩_⇩2_def Premise_def Transformation_def
BI_eq_iff
by clarsimp metis
paragraph ‹Deriving ToA›
subparagraph ‹1-to-1›
lemma [φreason_template name F.G.comm[no_atp]]:
‹ Tyops_Commute F F' G G' T D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ (r, RE) = (embedded_func f P, (x ⦂ F (G T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f x ⦂ G' (F' T) 𝗐𝗂𝗍𝗁 P x @tag 𝒯𝒫)) ∨⇩c⇩u⇩t
RE = (x ⦂ F (G T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (F' T) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒯𝒫)
@tag 𝒜_template_reason undefined
⟹ RE ›
unfolding Premise_def Action_Tag_def Tyops_Commute_def Orelse_shortcut_def
by (elim disjE; simp)
subparagraph ‹1-to-1λ›
lemma [φreason_template name F.G.comm[no_atp]]:
‹ Tyops_Commute⇩Λ⇩I F F' G G' T D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ (r, RE) = (embedded_func f P, (x ⦂ F (G T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f x ⦂ G' (λp. F' (T p)) 𝗐𝗂𝗍𝗁 P x @tag 𝒯𝒫)) ∨⇩c⇩u⇩t
RE = (x ⦂ F (G T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (λp. F' (T p)) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒯𝒫) @tag 𝒜_template_reason undefined
⟹ RE ›
unfolding Premise_def Action_Tag_def Tyops_Commute⇩Λ⇩I_def Orelse_shortcut_def Transformation_def
by (elim disjE; simp)
lemma [φreason_template name F.G.comm[no_atp]]:
‹ Tyops_Commute⇩Λ⇩E F F' G G' T D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ (r, RE) = (embedded_func f P, (x ⦂ F (λp. G (T p)) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f x ⦂ G' (F' T) 𝗐𝗂𝗍𝗁 P x @tag 𝒯𝒫)) ∨⇩c⇩u⇩t
RE = (x ⦂ F (λp. G (T p)) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (F' T) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒯𝒫) @tag 𝒜_template_reason undefined
⟹ RE ›
unfolding Premise_def Action_Tag_def Tyops_Commute⇩Λ⇩E_def Orelse_shortcut_def Transformation_def
by (elim disjE; simp)
subparagraph ‹1-to-2›
lemma Comm_Tyops⇩1⇩_⇩2_ToA_temlpate[φreason_template name F.G.comm[no_atp]]:
‹ Tyops_Commute⇩1⇩_⇩2 F F'⇩T F'⇩U G G' T U D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ (r, RE) = (embedded_func f P, (x ⦂ F (G T U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f x ⦂ G' (F'⇩T T) (F'⇩U U) 𝗐𝗂𝗍𝗁 P x @tag 𝒯𝒫)) ∨⇩c⇩u⇩t
RE = (x ⦂ F (G T U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (F'⇩T T) (F'⇩U U) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒯𝒫) @tag 𝒜_template_reason undefined
⟹ RE ›
unfolding Premise_def Action_Tag_def Tyops_Commute⇩1⇩_⇩2_def Orelse_shortcut_def
by (elim disjE; simp)
lemma Comm_Tyops⇩2⇩_⇩1_ToA_temlpate[φreason_template name F.G.comm[no_atp]]:
‹ Tyops_Commute⇩2⇩_⇩1 F F'⇩T F'⇩U G G' T U D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ (r, RE) = (embedded_func f P, (x ⦂ G' (F'⇩T T) (F'⇩U U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f x ⦂ F (G T U) 𝗐𝗂𝗍𝗁 P x @tag 𝒯𝒫)) ∨⇩c⇩u⇩t
RE = (x ⦂ G' (F'⇩T T) (F'⇩U U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F (G T U) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒯𝒫) @tag 𝒜_template_reason undefined
⟹ RE ›
unfolding Premise_def Action_Tag_def Tyops_Commute⇩2⇩_⇩1_def Orelse_shortcut_def
by (elim disjE; simp )
paragraph ‹Swapping Normalization›
subparagraph ‹1-to-1›
lemma [φreason_template name F.G.norm_src [φToA_SA_norm_simp default]]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute F F' G G' T D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ (⋀y. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 r' y : r x y @tag 𝒜_template_reason undefined)
⟹ x ⦂ F (G T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (F' T) 𝗌𝗎𝖻𝗃 y. r' y @tag 𝒜_transitive_simp ›
unfolding Transformation_def Action_Tag_def Tyops_Commute_def Premise_def
Simplify_def Action_Tag_def 𝗋Guard_def
by clarsimp
lemma [φreason_template name F.G.norm_tgt [φToA_SA_norm_simp default]]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute F F' G G' T D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ (⋀y. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 r' y : r x y @tag 𝒜_template_reason undefined)
⟹ x ⦂ F (G T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (F' T) 𝗌𝗎𝖻𝗃 y. r' y @tag 𝒜_backward_transitive_simp ›
unfolding Transformation_def Action_Tag_def Tyops_Commute_def Premise_def
Simplify_def Action_Tag_def 𝗋Guard_def
by clarsimp
paragraph ‹1-to-2›
lemma [φreason_template name F.G.norm_src [φToA_SA_norm_simp default]]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute⇩1⇩_⇩2 F F'⇩T F'⇩U G G' T U D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ (⋀y. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 r' y : r x y @tag 𝒜_template_reason undefined)
⟹ x ⦂ F (G T U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (F'⇩T T) (F'⇩U U) 𝗌𝗎𝖻𝗃 y. r' y @tag 𝒜_transitive_simp ›
unfolding Tyops_Commute⇩1⇩_⇩2_def Action_Tag_def Tyops_Commute_def Premise_def Simplify_def 𝗋Guard_def
by clarsimp
lemma [φreason_template name F.G.norm_tgt [φToA_SA_norm_simp default]]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute⇩2⇩_⇩1 F F'⇩T F'⇩U G G' T U D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ (⋀y. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 r' y : r x y @tag 𝒜_template_reason undefined)
⟹ x ⦂ G' (F'⇩T T) (F'⇩U U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F (G T U) 𝗌𝗎𝖻𝗃 y. r' y @tag 𝒜_backward_transitive_simp ›
unfolding Tyops_Commute⇩2⇩_⇩1_def Action_Tag_def Tyops_Commute_def Premise_def Simplify_def 𝗋Guard_def
by clarsimp
paragraph ‹2-to-1›
lemma [φreason_template name F.G.norm_src [φToA_SA_norm_simp default]]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute⇩2⇩_⇩1 F F'⇩T F'⇩U G G' T U D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ (⋀y. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 r' y : r x y @tag 𝒜_template_reason undefined)
⟹ x ⦂ G' (F'⇩T T) (F'⇩U U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F (G T U) 𝗌𝗎𝖻𝗃 y. r' y @tag 𝒜_transitive_simp ›
unfolding Tyops_Commute⇩2⇩_⇩1_def Action_Tag_def Tyops_Commute_def Premise_def Simplify_def 𝗋Guard_def
by clarsimp
lemma [φreason_template name F.G.norm_tgt [φToA_SA_norm_simp default]]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute⇩1⇩_⇩2 F F'⇩T F'⇩U G G' T U D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ (⋀y. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 r' y : r x y @tag 𝒜_template_reason undefined)
⟹ x ⦂ F (G T U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (F'⇩T T) (F'⇩U U) 𝗌𝗎𝖻𝗃 y. r' y @tag 𝒜_backward_transitive_simp ›
unfolding Tyops_Commute⇩1⇩_⇩2_def Action_Tag_def Tyops_Commute_def Premise_def Simplify_def 𝗋Guard_def
by clarsimp
paragraph ‹‹Λ››
lemma [φreason_template name F.G.norm_src [φToA_SA_norm_simp default]]:
‹ Tyops_Commute⇩Λ⇩I F F' G G' T D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ F (G T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (λp. F' (T p)) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒜_transitive_simp ›
unfolding Tyops_Commute⇩Λ⇩I_def Action_Tag_def Tyops_Commute_def Premise_def
by clarsimp
lemma [φreason_template name F.G.norm_src [φToA_SA_norm_simp default]]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute⇩Λ⇩E F F' G G' T D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ F (λp. G (T p)) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (F' T) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒜_transitive_simp ›
unfolding Tyops_Commute⇩Λ⇩E_def Action_Tag_def Tyops_Commute_def Premise_def 𝗋Guard_def
by clarsimp
lemma [φreason_template name F.G.norm_tgt [φToA_SA_norm_simp default]]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute⇩Λ⇩I F F' G G' T D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ F (G T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (λp. F' (T p)) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒜_backward_transitive_simp ›
unfolding Tyops_Commute⇩Λ⇩I_def Action_Tag_def Tyops_Commute_def Premise_def 𝗋Guard_def
by clarsimp
lemma [φreason_template name F.G.norm_tgt [φToA_SA_norm_simp default]]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute⇩Λ⇩E F F' G G' T D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ F (λp. G (T p)) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (F' T) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒜_backward_transitive_simp ›
unfolding Tyops_Commute⇩Λ⇩E_def Action_Tag_def Tyops_Commute_def Premise_def 𝗋Guard_def
by clarsimp
paragraph ‹Bubbling›
subparagraph ‹1-to-1›
lemma [φreason_template default %φsimp_derived_bubbling]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute F F' G G' T D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ F (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 G T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ 𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 G' (F' T) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒜simp ›
unfolding Tyops_Commute_def Premise_def Action_Tag_def Bubbling_def Simplify_def 𝗋Guard_def
by clarsimp
lemma [φreason_template default %φsimp_derived_bubbling]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute F F' G G' T D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ 𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F (G T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F' T) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒜backward_simp›
unfolding Tyops_Commute_def Premise_def Bubbling_def Transformation_def Action_Tag_def 𝗋Guard_def
by clarsimp
subparagraph ‹1-to-2›
lemma [φreason_template default %φsimp_derived_bubbling]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute⇩1⇩_⇩2 F F'⇩T F'⇩U G G' T U D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ F (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 G T U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ 𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 G' (F'⇩T T) (F'⇩U U) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒜simp ›
unfolding Tyops_Commute⇩1⇩_⇩2_def Premise_def Action_Tag_def Bubbling_def Simplify_def 𝗋Guard_def
by clarsimp
lemma [φreason_template default %φsimp_derived_bubbling+1]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute⇩1⇩_⇩2 F F'⇩T F'⇩U G G' T U D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ 𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F (G T U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F'⇩T T) (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F'⇩U U) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒜backward_simp›
unfolding Tyops_Commute⇩1⇩_⇩2_def Premise_def Bubbling_def Action_Tag_def 𝗋Guard_def
by clarsimp
lemma [φreason_template default %φsimp_derived_bubbling]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute⇩1⇩_⇩2 F F'⇩T F'⇩U G G' T U D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ 𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F (G T U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F'⇩T T) (F'⇩U U) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒜backward_simp›
unfolding Tyops_Commute⇩1⇩_⇩2_def Premise_def Bubbling_def Action_Tag_def 𝗋Guard_def
by clarsimp
lemma [φreason_template default %φsimp_derived_bubbling]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute⇩1⇩_⇩2 F F'⇩T F'⇩U G G' T U D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ 𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F (G T U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (F'⇩T T) (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F'⇩U U) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒜backward_simp›
unfolding Tyops_Commute⇩1⇩_⇩2_def Premise_def Bubbling_def Action_Tag_def 𝗋Guard_def
by clarsimp
subparagraph ‹2-to-1›
lemma [φreason_template default %φsimp_derived_bubbling+1]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute⇩2⇩_⇩1 F F'⇩T F'⇩U G G' T U D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ G' (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F'⇩T T) (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F'⇩U U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ 𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F (G T U) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒜simp ›
unfolding Tyops_Commute⇩2⇩_⇩1_def Premise_def Action_Tag_def Bubbling_def Simplify_def 𝗋Guard_def
by clarsimp
lemma [φreason_template default %φsimp_derived_bubbling]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute⇩2⇩_⇩1 F F'⇩T F'⇩U G G' T U D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ G' (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F'⇩T T) (F'⇩U U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ 𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F (G T U) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒜simp
<except-pattern> x ⦂ G' (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F'⇩T T) (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F'⇩U U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 YYY @tag 𝒜simp ›
unfolding Tyops_Commute⇩2⇩_⇩1_def Premise_def Action_Tag_def Bubbling_def Except_Pattern_def Simplify_def 𝗋Guard_def
by clarsimp
lemma [φreason_template default %φsimp_derived_bubbling]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute⇩2⇩_⇩1 F F'⇩T F'⇩U G G' T U D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ G' (F'⇩T T) (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F'⇩U U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ 𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F (G T U) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒜simp
<except-pattern> x ⦂ G' (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F'⇩T T) (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F'⇩U U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 YYY @tag 𝒜simp ›
unfolding Tyops_Commute⇩2⇩_⇩1_def Premise_def Action_Tag_def Bubbling_def Except_Pattern_def Simplify_def 𝗋Guard_def
by clarsimp
lemma [φreason_template default %φsimp_derived_bubbling]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute⇩2⇩_⇩1 F F'⇩T F'⇩U G G' T U D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ 𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 G' (F'⇩T T) (F'⇩U U) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 G T U) 𝗌𝗎𝖻𝗃 y. r x y @tag 𝒜backward_simp›
unfolding Tyops_Commute⇩2⇩_⇩1_def Premise_def Bubbling_def Action_Tag_def 𝗋Guard_def
by clarsimp
subparagraph ‹1-to-1λ›
lemma [φreason_template default %φsimp_derived_bubbling]:
‹ Tyops_Commute⇩Λ⇩I F F' G G' T D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ (x ⦂ F (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 G T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ 𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 G' (λp. F' (T p)) 𝗌𝗎𝖻𝗃 y. r x y) @tag 𝒜simp ›
unfolding Tyops_Commute⇩Λ⇩I_def Premise_def Bubbling_def Action_Tag_def Simplify_def
by simp
lemma [φreason_template default %φsimp_derived_bubbling]:
‹ Tyops_Commute⇩Λ⇩E F F' G G' T D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ (x ⦂ F (λp. G (T p)) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (F' T) 𝗌𝗎𝖻𝗃 y. r x y) @tag 𝒜simp ›
unfolding Tyops_Commute⇩Λ⇩E_def Premise_def Bubbling_def Action_Tag_def Simplify_def
by simp
paragraph ‹To-Transformation Interpreter›
lemma [φreason_template default %To_ToA_derived]:
‹ 𝗀𝗎𝖺𝗋𝖽 Tyops_Commute F F' G G' T D r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x
⟹ x ⦂ F (G T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ G' (F' T) 𝗌𝗎𝖻𝗃 y. r x y @tag to (𝖼𝗈𝗆𝗆𝗎𝗍𝖾 F G) ›
unfolding Tyops_Commute_def Premise_def Action_Tag_def Except_Pattern_def Simplify_def 𝗋Guard_def
by clarsimp
section ‹Property Derivers›
subsection ‹Extension of BNF-FP›
ML_file ‹library/phi_type_algebra/tools/BNF_fp_sugar_more.ML›
ML_file ‹library/phi_type_algebra/tools/extended_BNF_info.ML›
subsection ‹Deriver Framework›
consts φTA_subgoal :: ‹action ⇒ action›
φTA_ANT :: action
φTA_conditioned_ToA_template :: action
φTA_pure_facts :: action
φTA_ToA_elim :: action
definition ‹φTA_IND_TARGET T = T›
lemmas intro_φTA_ANT = Action_Tag_def[where A=‹φTA_ANT›, symmetric, THEN Meson.TruepropI]
lemma mk_ToA_rule:
‹ A 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 B 𝗐𝗂𝗍𝗁 P
⟹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 A 𝗐𝗂𝗍𝗁 Q @tag 𝒯𝒫
⟹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 B 𝗐𝗂𝗍𝗁 Q ∧ P @tag 𝒯𝒫›
using transformation_trans Action_Tag_def
by blast
lemma mk_ToA_rule':
‹ A 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 B 𝗐𝗂𝗍𝗁 P
⟹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 A 𝗋𝖾𝗆𝖺𝗂𝗇𝗌 R 𝗐𝗂𝗍𝗁 Q @tag 𝒯𝒫
⟹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 B 𝗋𝖾𝗆𝖺𝗂𝗇𝗌 R 𝗐𝗂𝗍𝗁 Q ∧ P @tag 𝒯𝒫›
unfolding REMAINS_def Action_Tag_def
by (simp add: transformation_right_frame transformation_trans)
lemma mk_ToA_rule_varified:
‹ A 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x' ⦂ T 𝗐𝗂𝗍𝗁 P
⟹ Object_Equiv T eq
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 eq x' x ⟹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 A 𝗐𝗂𝗍𝗁 Q @tag 𝒯𝒫)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 eq x' x
⟹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ T 𝗐𝗂𝗍𝗁 Q ∧ P @tag 𝒯𝒫›
unfolding Premise_def Object_Equiv_def Transformation_def Action_Tag_def
by clarsimp blast
lemma mk_ToA_rule'_varified:
‹ A 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x' ⦂ T 𝗐𝗂𝗍𝗁 P
⟹ Object_Equiv T eq
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 eq x' x ⟹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 A 𝗋𝖾𝗆𝖺𝗂𝗇𝗌 R 𝗐𝗂𝗍𝗁 Q @tag 𝒯𝒫)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 eq x' x
⟹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ T 𝗋𝖾𝗆𝖺𝗂𝗇𝗌 R 𝗐𝗂𝗍𝗁 Q ∧ P @tag 𝒯𝒫›
unfolding REMAINS_def Premise_def Object_Equiv_def Transformation_def Action_Tag_def
by (clarsimp; blast)
lemma [fundef_cong]:
‹T x = T' x' ⟹ (x ⦂ T) = (x' ⦂ T')›
unfolding φType_def by simp
lemma φTA_ind_target_strip:
‹ X @tag φTA_subgoal 𝒜 ≡ X @tag 𝒜 ›
unfolding Action_Tag_def .
lemma φTA_common_rewr_imp1:
‹ Trueprop (Ant ⟶ X @tag φTA_subgoal A) ≡ (Ant ⟹ X @tag A) ›
unfolding Action_Tag_def atomize_imp .
lemma φTA_common_rewr_imp1_noact:
‹ Trueprop (Ant ⟶ X @tag φTA_subgoal A) ≡ (Ant ⟹ X) ›
unfolding Action_Tag_def atomize_imp .
lemma φTA_common_rewr_imp1_rev:
‹ (Ant ⟹ X @tag A) ≡ Trueprop (Ant ⟶ X @tag A) ›
unfolding Action_Tag_def atomize_imp .
lemma φTA_common_rewr_imp2:
‹ Trueprop (Ant ⟶ C ⟶ X @tag φTA_subgoal 𝒜)
≡ (Ant ⟹ C ⟹ X @tag 𝒜) ›
unfolding Action_Tag_def atomize_imp .
lemma φTA_common_rewr_imp2':
‹ Trueprop (Ant ⟶ Q ⟶ P @tag φTA_subgoal 𝒜)
≡ (Ant ⟹ Q ⟶ (P @tag 𝒜)) ›
unfolding Action_Tag_def atomize_imp .
lemma φTA_common_rewr_imp2_rev:
‹ (Ant ⟹ C ⟹ X @tag 𝒜) ≡ Trueprop (Ant ⟶ C ⟶ X @tag 𝒜) ›
unfolding Action_Tag_def atomize_imp .
lemma φTA_common_rewr_imp2_noact:
‹ Trueprop (Ant ⟶ C ⟶ X @tag φTA_subgoal A)
≡ (Ant ⟹ C ⟹ X) ›
unfolding Action_Tag_def atomize_imp .
lemma φTA_reason_rule__simp:
‹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 X' 𝗐𝗂𝗍𝗁 Any' @tag 𝒜_apply_simplication
⟹ X' 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y
⟹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y @tag 𝒜simp›
unfolding Action_Tag_def
by (simp add: Transformation_def)
lemma φTA_reason_rule__𝒜_simp:
‹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 X' 𝗐𝗂𝗍𝗁 Any @tag 𝒜_map_each_item A
⟹ X' 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 X'' 𝗐𝗂𝗍𝗁 Any' @tag 𝒜_apply_simplication
⟹ X'' 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y
⟹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y @tag A›
unfolding Action_Tag_def
by (simp add: Transformation_def)
lemma elim_TA_ANT:
‹ ((PROP A ⟹ PROP C) ⟹ PROP A ⟹ PROP B) ≡ (PROP A ⟹ PROP C ⟹ PROP B) ›
apply rule
subgoal premises prems by (rule prems(1), rule prems(3), rule prems(2))
subgoal premises prems by (rule prems(1), rule prems(3), rule prems(2), rule prems(3)) .
ML_file ‹library/phi_type_algebra/deriver_framework.ML›
consts φderiver_expansion :: mode
φreasoner_ML φderiver_expansion %cutting
(‹Premise φderiver_expansion _› | ‹Simplify φderiver_expansion ?X' ?X› )
= ‹Phi_Reasoners.wrap (PLPR_Simplifier.simplifier (K Seq.empty)
Phi_Type_Derivers.equip_expansion_ss0 {fix_vars=true}) o snd›
subsection ‹Extending Property Guessers›
text ‹When derivers provide gussers of specific strategies typically based on the logic types of the
abstract domain, boolean constraints implies inside can in addition augment the guessing.
The section aims to provide a general mechanism syntactically extracting the constraints.
The extraction works in two modes,
▪ covariant, where the boolean constraints are proof obligations have to be shown, and the φ-type
typically locates at the right hand side of a transformation;
▪ contra-variant, where the constraints are conditions constraining the proof obligations, and the
φ-type typically locates at the left hand side of a transformation.
›
text ‹When guessing the property, the system first tries to see if there is any user overridings
by ‹Guess_Property› reasoning which gives the desired property entirely, if not, it goes to the normal
guesser procedure implemented by each deriver, and after obtaining the guessed property,
the system runs the ‹Guess_Property› again with the ‹guessed_conclusion› setting to None to force
guessing the antecedents only, in this way to refine the already guessed antecedent either by
adding new antecedents or constraining the antecedents by conditions.›
type_synonym variant = bool
definition Guess_Property :: ‹'property_const ⇒ variant ⇒ ('c,'a) φ ⇒ ('c,'a) φ ⇒ bool ⇒ ('a ⇒ bool) ⇒ ('a ⇒ bool) ⇒ bool›
where ‹Guess_Property the_constant_of_the_property_predicate
variantness_of_the_property
original_φtype unfolded_φtype
guessed_antecedents guessed_proof_obligation yielded_conditions
≡ True›
declare [[
φreason_default_pattern ‹Guess_Property ?PC ?V ?T ?uT _ _ _› ⇒
‹Guess_Property ?PC ?V ?T ?uT _ _ _› (100)
]]
φreasoner_group φTA_guesser = (100, [80, 2999]) for ‹Guess_Property PC V T uT a pa cond›
‹User heuristics overriding or extending the guesser mechanism of φtype derivers.›
and φTA_guesser_init = (3000, [3000, 3000]) for ‹Guess_Property PC V T uT a pa cond› > φTA_guesser
‹Initializing the Guessing›
and φTA_guesser_default = (30, [2, 79]) for ‹Guess_Property PC V T uT a pa cond› < φTA_guesser
‹Default rules handling logical connectives›
and φTA_guesser_assigning_variant = (2200, [2200,2200]) for ‹Guess_Property PC V T uT a pa cond›
in φTA_guesser and > φTA_guesser_default
‹Fallbacks using common default rules›
and φTA_guesser_fallback = (1,[1,1]) for ‹Guess_Property PC V T uT a pa cond› < φTA_guesser_default
‹Fallbacks of Guess_Property›
ML_file ‹library/phi_type_algebra/guess_property.ML›
paragraph ‹System Rules›
lemma [φreason default %φTA_guesser_fallback]:
‹Guess_Property PC V T T' True (λ_. True) (λ_. True)›
unfolding Guess_Property_def ..
lemma [φreason default %φTA_guesser_init]:
‹(⋀x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_T' x) : (x ⦂ T) )
⟹ Guess_Property PC V T var_T' a p c
⟹ Guess_Property PC V T var_T' a p c ›
unfolding Guess_Property_def ..
paragraph ‹Preset›
lemma [φreason default %φTA_guesser_default]:
‹ Guess_Property PC False T A a p c
⟹ Guess_Property PC False T (λx. A x 𝗌𝗎𝖻𝗃 P x) a p (λx. P x ∧ c x) ›
‹ (⋀c. Guess_Property PC False T (λx. A' x c) (a' c) (p' c) (cond c))
⟹ Guess_Property PC False T (λx. ExBI (A' x)) (All a') (λx. ∀c. p' c x) (λx. ∃c. cond c x)›
unfolding Guess_Property_def ..
lemma [φreason default %φTA_guesser_default]:
‹ Guess_Property PC True T A a p c
⟹ Guess_Property PC True T (λx. A x 𝗌𝗎𝖻𝗃 P x) a (λx. P x ∧ p x) c ›
‹ (⋀c. Guess_Property PC True T (λx. A' x c) (a' c) (c' c) (cond c))
⟹ Guess_Property PC True T (λx. ExBI (A' x)) (Ex a') (λx. ∃c. c' c x) (λx. ∀c. cond c x) ›
unfolding Guess_Property_def ..
lemma [φreason %φTA_guesser_default]:
‹ Guess_Property PC V T A a1 p1 c1
⟹ Guess_Property PC V T B a2 p2 c2
⟹ Guess_Property PC V T (λx. A x * B x) (a1 ∧⇩𝗋 a2) (λx. p1 x ∧ p2 x) (λx. c1 x ∧ c2 x)›
unfolding Guess_Property_def ..
subsection ‹Simplify Result›
definition Simplify_Result :: ‹prop ⇒ prop ⇒ prop› where ‹Simplify_Result P Q ≡ (PROP P ⟹ PROP Q)›
lemma DO_Simplify_Result:
‹ PROP P
⟹ PROP Simplify_Result P Q
⟹ 𝗋Success
⟹ PROP Q ›
unfolding Simplify_Result_def .
text ‹Simplifies only naked conditions (in sens of not wrapped by ‹⋀› or ‹⟹›) but not arbitrary antecedents›
paragraph ‹Basic Rules›
lemma
‹ PROP 𝒜EIF' A A'
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 A' ⟹ PROP Simplify_Result (PROP B) (PROP B'))
⟹ PROP Simplify_Result (PROP A ⟹ PROP B) (PROP A ⟹ PROP B') ›
unfolding Simplify_Result_def Premise_def 𝒜EIF'_def
subgoal premises prems
by (rule prems(2), rule prems(1), rule prems(4), rule prems(3), rule prems(4)) .
subsection ‹Warn if the Def contains Sat›
φproperty_deriver Warn_if_contains_Sat 10 = ‹fn (quiet, _) => fn [] => fn phi => fn thy => (
if Phi_Syntax.is_nonnull_Type_Opr (Term.fastype_of (#term phi)) andalso
Phi_Type.def_contains_satisfaction phi andalso
not quiet
then warning ("The φ-type definition contains satisfaction operator (⊨).\n\
\When a φ-type is specified by satisfaction in a boolean assertion, it looses the ability to guide the reasoning.\n\
\The deriving may fail. It is recommended to use composition operator (⨾) to replace the (⊨) if possible.")
else () ;
thy
)›
subsection ‹Meta Deriver for Pure Syntactical Properties›
ML_file ‹library/phi_type_algebra/gen_pure_synt_rules.ML›
φproperty_deriver Semimodule_No_SDistr 100
= ‹Phi_Type_Derivers.meta_Synt_Deriver
("Semimodule_No_SDistr",
@{lemma' ‹Semimodule_No_SDistr F› by (simp add: Semimodule_No_SDistr_def)},
SOME (@{reasoner_group %Semimodule_No_SDistr})) ›
subsection ‹Abstract Domain›
context begin
private lemma φTA_Inh_rule:
‹ (⋀x. Ant ⟹ (x ⦂ OPEN undefined T 𝗂𝗆𝗉𝗅𝗂𝖾𝗌 P x) @tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Abstract_Domain T P›
unfolding Action_Tag_def Abstract_Domain_def OPEN_def 𝗋EIF_def
by simp
private lemma φTA_SuC_rule:
‹ (⋀x. Ant ⟹ (P x 𝗌𝗎𝖿𝖿𝗂𝖼𝖾𝗌 x ⦂ MAKE undefined T) @tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Abstract_Domain⇩L T P›
unfolding Action_Tag_def Abstract_Domain⇩L_def MAKE_def 𝗋ESC_def
by simp
private lemma φTA_Inh_step:
‹ Inh 𝗂𝗆𝗉𝗅𝗂𝖾𝗌 Any
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (Any ⟶ P)
⟹ Inh 𝗂𝗆𝗉𝗅𝗂𝖾𝗌 P ›
unfolding Action_Tag_def Premise_def 𝗋EIF_def
by blast
private lemma φTA_Suc_step:
‹ Any 𝗌𝗎𝖿𝖿𝗂𝖼𝖾𝗌 Inh
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (P ⟶ Any)
⟹ P 𝗌𝗎𝖿𝖿𝗂𝖼𝖾𝗌 Inh ›
unfolding Action_Tag_def Premise_def 𝗋ESC_def
by blast
private lemma φTA_Inh_rewr_IH:
‹ Trueprop (Ant ⟶ (x ⦂ OPEN undefined T 𝗂𝗆𝗉𝗅𝗂𝖾𝗌 P) @tag φTA_subgoal A)
≡ (Ant ⟹ (x ⦂ T 𝗂𝗆𝗉𝗅𝗂𝖾𝗌 P)) ›
unfolding Action_Tag_def atomize_imp OPEN_def .
private lemma φTA_Suc_rewr_IH:
‹ Trueprop (Ant ⟶ (P 𝗌𝗎𝖿𝖿𝗂𝖼𝖾𝗌 x ⦂ MAKE undefined T) @tag φTA_subgoal A)
≡ (Ant ⟹ (P 𝗌𝗎𝖿𝖿𝗂𝖼𝖾𝗌 x ⦂ MAKE undefined T)) ›
unfolding Action_Tag_def atomize_imp OPEN_def .
ML_file ‹library/phi_type_algebra/implication.ML›
end
φproperty_deriver Abstract_Domain⇩L 89 for ( ‹Abstract_Domain⇩L _ _› ) = ‹
Phi_Type_Derivers.abstract_domain_L
›
φproperty_deriver Abstract_Domain 90 for ( ‹Abstract_Domain _ _› ) = ‹
Phi_Type_Derivers.abstract_domain
›
subsection ‹Identity Element Intro \& Elim›
context begin
private lemma φTA_1L_rule:
‹ (⋀x. Ant ⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x ⟹ Identity_Element⇩I (x ⦂ OPEN undefined T) (P x) @tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Identity_Elements⇩I T D P ›
unfolding Action_Tag_def Identity_Elements⇩I_def OPEN_def
by blast
private lemma φTA_1R_rule:
‹ (⋀x. Ant ⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x ⟹ Identity_Element⇩E (x ⦂ MAKE undefined T) @tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Identity_Elements⇩E T D›
unfolding Action_Tag_def Identity_Elements⇩E_def MAKE_def
by blast
private lemma φTA_Ident_I_rule_step:
‹ X 𝗂𝗆𝗉𝗅𝗂𝖾𝗌 A
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 A ⟹ Identity_Element⇩I X Q)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (A ⟶ Q ⟶ P)
⟹ Identity_Element⇩I X P ›
unfolding Identity_Element⇩I_def Premise_def Action_Tag_def Transformation_def Satisfiable_def 𝗋EIF_def
by (clarsimp, blast)
ML_file ‹library/phi_type_algebra/identity_element.ML›
end
φproperty_deriver Identity_Elements⇩I 101 for (‹Identity_Elements⇩I _ _ _›)
= ‹Phi_Type_Derivers.identity_element_I›
φproperty_deriver Identity_Elements⇩E 102 for (‹Identity_Elements⇩E _ _›)
= ‹Phi_Type_Derivers.identity_element_E›
φproperty_deriver Identity_Element_Properties⇩I 103
= ‹fn (_, pos) => (K (Phi_Type_Derivers.id_ele_properties pos true))›
φproperty_deriver Identity_Element_Properties⇩E 103
= ‹fn (_, pos) => (K (Phi_Type_Derivers.id_ele_properties pos false))›
φproperty_deriver Identity_Element_Properties 104
requires Identity_Element_Properties⇩I and Identity_Element_Properties⇩E
φproperty_deriver Identity_Elements 105
requires Identity_Elements⇩I and Identity_Elements⇩E and Identity_Element_Properties
paragraph ‹Guessing Antecedents›
subsection ‹Object Equivalence›
context begin
private lemma Object_Equiv_rule:
‹ 𝗋EIF Ant Ant'
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ant' ⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀x. eq x x))
⟹ (⋀x y. Ant ⟹ eq x y ⟹ (x ⦂ OPEN undefined T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ MAKE undefined T) @tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Object_Equiv T eq ›
unfolding Object_Equiv_def Premise_def Action_Tag_def MAKE_def OPEN_def 𝗋EIF_def
by blast
private lemma φTA_OE_rewr_IH:
‹Trueprop (Ant ⟶ (∀y. P y ⟶ (x ⦂ OPEN undefined T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f y ⦂ MAKE undefined U)) @tag φTA_subgoal undefined)
≡ (⋀y. Ant ⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 P y ⟹ x ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f y ⦂ φTA_IND_TARGET U @tag φTA_ToA_elim)›
unfolding Action_Tag_def atomize_imp atomize_all Premise_def OPEN_def MAKE_def
φTA_IND_TARGET_def
by (rule; blast)
private lemma φTA_OE_rewr_pre:
‹ (⋀y. Ant ⟹ P y ⟹ C y @tag 𝒜)
≡ Trueprop (Ant ⟶ (∀y. P y ⟶ C y) @tag 𝒜) ›
unfolding Action_Tag_def atomize_imp atomize_all
by (rule; blast)
private lemma φTA_OE_rewr_CL:
‹ Trueprop (Ant ⟶ (∀y. C y ⟶ X y) @tag 𝒜)
≡ (⋀y. Ant ⟹ C y ⟹ X y) ›
unfolding Action_Tag_def atomize_imp atomize_all Premise_def OPEN_def MAKE_def
by (rule; blast)
lemma ex_pure_imp:
‹ (∃x. P x ⟹ PROP Q) ≡ (⋀x. P x ⟹ PROP Q) ›
proof
fix x
assume A: ‹∃x. P x ⟹ PROP Q›
and B: ‹P x›
from B have ‹∃x. P x› by blast
from A[OF this] show ‹PROP Q› .
next
assume A: ‹⋀x. P x ⟹ PROP Q›
and B: ‹∃x. P x›
from B have ‹P (@x. P x)› by (simp add: someI_ex)
from A[OF this] show ‹PROP Q› .
qed
private lemma φTA_OE_rewr:
‹Trueprop (∀y. P y ⟶ Q y) ≡ (⋀y. 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 P y ⟹ Q y)›
unfolding Action_Tag_def atomize_imp atomize_all Premise_def
by (rule; blast)
private lemma φTA_OE_rewr':
‹Trueprop (∀y. P y ⟶ Q y) ≡ (⋀y. 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 P y ⟹ Q y)›
unfolding Action_Tag_def atomize_imp atomize_all Premise_def
by (rule; blast)
private lemma φTA_OE_simp:
‹ Object_Equiv T eq
⟹ Abstract_Domain T D
⟹ (⋀x y. 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 D x ⟹ 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 eq' x y : eq x y)
⟹ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 ((∀x. eq x x) ⟶ (∀x. eq' x x))
⟹ Object_Equiv T eq' ›
unfolding Object_Equiv_def Transformation_def Simplify_def Premise_def
Abstract_Domain_def Action_Tag_def Satisfiable_def 𝗋EIF_def
by clarsimp blast
ML_file ‹library/phi_type_algebra/object_equiv.ML›
end
φproperty_deriver Object_Equiv 105 for (‹Object_Equiv _ _›)
= ‹Phi_Type_Derivers.object_equiv›
subsection ‹Functionality›
context begin
private lemma φTA_IsFunc_rule:
‹ (⋀x. Ant ⟹
𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 P x ⟹
Is_Functional (x ⦂ OPEN undefined T) @tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Functionality T P ›
unfolding Action_Tag_def Functionality_def Is_Functional_def Premise_def OPEN_def
by clarsimp
private lemma φTA_IsFunc_cong:
‹ P ≡ P'
⟹ Functionality T P ≡ Functionality T P' ›
by simp
private lemma φTA_IsFunc_rewr_IH:
‹ Trueprop (Ant ⟶ C ⟶ Is_Functional (x ⦂ OPEN undefined T) @tag φTA_subgoal A)
≡ (Ant ⟹ C ⟹ Is_Functional (x ⦂ T)) ›
unfolding Action_Tag_def atomize_imp OPEN_def .
ML_file ‹library/phi_type_algebra/is_functional.ML›
end
φproperty_deriver Functionality 100 for (‹Functionality _ _›)
= ‹ Phi_Type_Derivers.is_functional ›
subsection ‹Carrier Set›
context begin
private lemma φTA_CarS_rule:
‹ (⋀x. Ant ⟹
𝗉𝗋𝖾𝗆𝗂𝗌𝖾 P x ⟹
Within_Carrier_Set (x ⦂ OPEN undefined T) @tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Carrier_Set T P ›
unfolding Carrier_Set_def Action_Tag_def Premise_def OPEN_def
by clarsimp
private lemma φTA_CarS_cong:
‹ P ≡ P'
⟹ Carrier_Set T P ≡ Carrier_Set T P' ›
by simp
private lemma φTA_CarS_rewr_IH:
‹ Trueprop (Ant ⟶ C ⟶ Within_Carrier_Set (x ⦂ OPEN undefined T) @tag φTA_subgoal A)
≡ (Ant ⟹ C ⟹ Within_Carrier_Set (x ⦂ T)) ›
unfolding Action_Tag_def atomize_imp OPEN_def .
ML_file ‹library/phi_type_algebra/carrier_set.ML›
end
φproperty_deriver Carrier_Set 100 for (‹Carrier_Set _ _›)
= ‹ Phi_Type_Derivers.carrier_set ›
φproperty_deriver Basic 109
requires Object_Equiv and Abstract_Domain and Carrier_Set ?
subsection ‹Type Inhabitance›
context begin
private lemma inh_typ_derv_rule:
‹ (Ant @tag φTA_ANT ⟹ Inhabited T)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Inhabited T › .
ML_file ‹library/phi_type_algebra/inhabited_type.ML›
end
φproperty_deriver Inhabited 100 for (‹Inhabited _›)
= ‹ Phi_Type_Derivers.inhabited_type ›
subsection ‹Equivalent Class›
context begin
private lemma φTA_EC_rule:
‹ (Ant ⟹ Equiv_Class (λx. x ⦂ OPEN undefined T) r @tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Equiv_Class T r ›
unfolding Action_Tag_def OPEN_def φType_def .
ML_file ‹library/phi_type_algebra/equiv_class.ML›
end
φproperty_deriver Equiv_Class 100 for (‹Equiv_Class _ _›)
= ‹ Phi_Type_Derivers.equiv_class ›
subsection ‹Transformation Functor›
context begin
private lemma φTA_TF_rule:
‹(⋀g x. 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (∀a b. a ∈ D x ∧ g a b ⟶ b ∈ R x) ⟹
Ant ⟹
(⋀a. 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 a ∈ D x ⟹ a ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U 𝗌𝗎𝖻𝗃 b. g a b @tag to U) ⟹
(x ⦂ OPEN undefined (F1 T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ MAKE undefined (F2 U) 𝗌𝗎𝖻𝗃 y. mapper g x y) @tag φTA_subgoal (to (𝗍𝗋𝖺𝗏𝖾𝗋𝗌𝖾 𝗉𝖺𝗍𝗍𝖾𝗋𝗇 T ⇒ U)))
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Transformation_Functor F1 F2 T U D R mapper›
unfolding Transformation_Functor_def Action_Tag_def Ball_def Premise_def
OPEN_def MAKE_def
by simp
private lemma φTA_TF_deriver_cong:
‹ D ≡ D'
⟹ (⋀x. ∃a. a ∈ D' x ⟹ R x ≡ R' x)
⟹ (⋀g x y. Satisfiable (x ⦂ F1 T) ⟹ Satisfiable (y ⦂ F2 U) ⟹ m g x y ≡ m' g x y)
⟹ Transformation_Functor F1 F2 T U D R m ≡ Transformation_Functor F1 F2 T U D' R' m' ›
unfolding Transformation_Functor_def atomize_eq Transformation_def Satisfiable_def
by clarsimp blast
private lemma φTA_TF_rewr_C:
‹Trueprop (Ant ⟶ (∀x. P x ⟶ A2 x) ⟶ C @tag φTA_subgoal 𝒜)
≡ (Ant ⟹ (⋀x. P x ⟹ A2 x) ⟹ C @tag 𝒜)›
unfolding Action_Tag_def atomize_imp atomize_all .
private lemma φTA_TF_rewr_pre:
‹(Ant ⟹ (⋀x. P x ⟹ A2 x) ⟹ C @tag 𝒜)
≡ Trueprop (Ant ⟶ (∀x. P x ⟶ A2 x) ⟶ C @tag 𝒜)›
unfolding Action_Tag_def atomize_imp atomize_all .
paragraph ‹Bi-Functor›
private lemma φTA_biTF_rule:
‹(⋀g⇩1 g⇩2 x. 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (∀a b. a ∈ D⇩1 x ∧ g⇩1 a b ⟶ b ∈ R⇩1 x) ∧ (∀a b. a ∈ D⇩2 x ∧ g⇩2 a b ⟶ b ∈ R⇩2 x) ⟹
Ant ⟹
(⋀a. 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 a ∈ D⇩1 x ⟹ a ⦂ T⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩1 𝗌𝗎𝖻𝗃 b. g⇩1 a b @tag to U⇩1) ⟹
(⋀a. 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 a ∈ D⇩2 x ⟹ a ⦂ T⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U⇩2 𝗌𝗎𝖻𝗃 b. g⇩2 a b @tag to U⇩2) ⟹
(x ⦂ OPEN undefined (F1 T⇩1 T⇩2) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ MAKE undefined (F2 U⇩1 U⇩2) 𝗌𝗎𝖻𝗃 y. mapper g⇩1 g⇩2 x y)
@tag φTA_subgoal (to (𝗍𝗋𝖺𝗏𝖾𝗋𝗌𝖾 𝗉𝖺𝗍𝗍𝖾𝗋𝗇 T⇩1 ⇒ U⇩1 𝗈𝗋𝖾𝗅𝗌𝖾 𝗉𝖺𝗍𝗍𝖾𝗋𝗇 T⇩2 ⇒ U⇩2)))
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Transformation_BiFunctor F1 F2 T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 mapper›
unfolding Transformation_BiFunctor_def Action_Tag_def Ball_def Premise_def
OPEN_def MAKE_def
by simp
private lemma φTA_biTF_rewr_C:
‹Trueprop (Ant ⟶ (∀x. P1 x ⟶ A1 x) ⟶ (∀x. P2 x ⟶ A2 x) ⟶ C @tag φTA_subgoal 𝒜)
≡ (Ant ⟹ (⋀x. P1 x ⟹ A1 x) ⟹ (⋀x. P2 x ⟹ A2 x) ⟹ C @tag 𝒜)›
unfolding Action_Tag_def atomize_imp atomize_all .
private lemma φTA_biTF_rewr_pre:
‹(Ant ⟹ (⋀x. P1 x ⟹ A1 x) ⟹ (⋀x. P2 x ⟹ A2 x) ⟹ C @tag 𝒜)
≡ Trueprop (Ant ⟶ (∀x. P1 x ⟶ A1 x) ⟶ (∀x. P2 x ⟶ A2 x) ⟶ C @tag 𝒜)›
unfolding Action_Tag_def atomize_imp atomize_all .
private lemma φTA_biTF_deriver_cong:
‹ D⇩1 ≡ D'⇩1
⟹ D⇩2 ≡ D'⇩2
⟹ (⋀x. ∃a. a ∈ D'⇩1 x ⟹ R⇩1 x ≡ R'⇩1 x)
⟹ (⋀x. ∃a. a ∈ D'⇩2 x ⟹ R⇩2 x ≡ R'⇩2 x)
⟹ (⋀g⇩1 g⇩2 x y. Satisfiable (x ⦂ F1 T⇩1 T⇩2) ⟹ Satisfiable (y ⦂ F2 U⇩1 U⇩2) ⟹ m g⇩1 g⇩2 x y ≡ m' g⇩1 g⇩2 x y)
⟹ Transformation_BiFunctor F1 F2 T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 m
≡ Transformation_BiFunctor F1 F2 T⇩1 T⇩2 U⇩1 U⇩2 D'⇩1 D'⇩2 R'⇩1 R'⇩2 m' ›
unfolding Transformation_BiFunctor_def atomize_eq Transformation_def Satisfiable_def
by clarsimp (smt (verit, ccfv_threshold))
paragraph ‹Parameterization›
private lemma φTA_TF⇩Λ_rule:
‹ (⋀g x. 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 (∀p a b. a ∈ D p x ∧ g p a b ⟶ b ∈ R p x) ⟹
Ant ⟹
(⋀p a. 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 a ∈ D p x ⟹ a ⦂ T p 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 b ⦂ U p 𝗌𝗎𝖻𝗃 b. g p a b @tag to (U p)) ⟹
(x ⦂ MAKE undefined (F1 T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ OPEN undefined (F2 U) 𝗌𝗎𝖻𝗃 y. mapper g x y) @tag φTA_subgoal (to (𝗍𝗋𝖺𝗏𝖾𝗋𝗌𝖾 𝗉𝖺𝗍𝗍𝖾𝗋𝗇 T ⇒ U)))
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Transformation_Functor⇩Λ F1 F2 T U D R mapper ›
unfolding Transformation_Functor⇩Λ_def Action_Tag_def Ball_def Premise_def
OPEN_def MAKE_def
by clarsimp
private lemma φTA_TF⇩Λ_deriver_cong:
‹ D ≡ D'
⟹ (⋀p x. ∃a. a ∈ D' p x ⟹ R p x ≡ R' p x)
⟹ (⋀g x y. Satisfiable (x ⦂ F1 T) ⟹ Satisfiable (y ⦂ F2 U) ⟹ m g x y ≡ m' g x y)
⟹ Transformation_Functor⇩Λ F1 F2 T U D R m ≡ Transformation_Functor⇩Λ F1 F2 T U D' R' m' ›
unfolding Transformation_Functor⇩Λ_def atomize_eq Transformation_def Satisfiable_def
by clarsimp blast
private lemma φTA_TF⇩Λ_rewr_C:
‹Trueprop (Ant ⟶ (∀p x. P p x ⟶ A2 p x) ⟶ C @tag φTA_subgoal 𝒜)
≡ (Ant ⟹ (⋀p x. P p x ⟹ A2 p x) ⟹ C @tag 𝒜)›
unfolding Action_Tag_def atomize_imp atomize_all .
private lemma φTA_TF⇩Λ_rewr_pre:
‹(Ant ⟹ (⋀p x. P p x ⟹ A2 p x) ⟹ C @tag 𝒜)
≡ Trueprop (Ant ⟶ (∀p x. P p x ⟶ A2 p x) ⟶ C @tag 𝒜)›
unfolding Action_Tag_def atomize_imp atomize_all .
subsection ‹Functional Transformation Functor›
paragraph ‹Functor›
private lemma φTA_FTF_rule:
‹ 𝗋EIF Ant Ant'
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ant' ⟹ Transformation_Functor F1 F2 T U D R mapper)
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ant' ⟹ Object_Equiv (F2 U) eq)
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ant' ⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀f P x y. mapper (λa b. b = f a ∧ P a) x y ⟶ eq y (fm f P x) ∧ pm f P x))
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Functional_Transformation_Functor F1 F2 T U D R pm fm›
unfolding Premise_def fun_eq_iff Action_Tag_def 𝗋EIF_def
using infer_FTF_from_FT
by blast
private lemma φTA_FTF_deriver_cong:
‹ D ≡ D'
⟹ (⋀x. ∃a. a ∈ D' x ⟹ R x ≡ R' x)
⟹ (⋀f P x. Satisfiable (x ⦂ F1 T) ⟹ fm f P x ≡ fm' f P x)
⟹ (⋀f P x. Satisfiable (x ⦂ F1 T) ⟹ Satisfiable (fm' f P x ⦂ F2 U) ⟹ pm f P x ≡ pm' f P x)
⟹ Functional_Transformation_Functor F1 F2 T U D R pm fm ≡
Functional_Transformation_Functor F1 F2 T U D' R' pm' fm' ›
unfolding Functional_Transformation_Functor_def atomize_eq Transformation_def Satisfiable_def
by (clarsimp, smt (verit, best))
paragraph ‹Bi-Functor›
private lemma φTA_biFTF_rule:
‹ 𝗋EIF Ant Ant'
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ant' ⟹ Transformation_BiFunctor F1 F2 T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 mapper)
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ant' ⟹ Object_Equiv (F2 U⇩1 U⇩2) eq)
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ant' ⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀f⇩1 f⇩2 P⇩1 P⇩2 x y. mapper (λa b. b = f⇩1 a ∧ P⇩1 a) (λa b. b = f⇩2 a ∧ P⇩2 a) x y
⟶ eq y (fm f⇩1 f⇩2 P⇩1 P⇩2 x) ∧ pm f⇩1 f⇩2 P⇩1 P⇩2 x))
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Functional_Transformation_BiFunctor F1 F2 T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 pm fm›
unfolding Premise_def fun_eq_iff Action_Tag_def 𝗋EIF_def
using infer_biFTF_from_biFT
by blast
private lemma φTA_biFTF_deriver_cong:
‹ D⇩1 ≡ D'⇩1
⟹ D⇩2 ≡ D'⇩2
⟹ (⋀x. ∃a. a ∈ D'⇩1 x ⟹ R⇩1 x ≡ R'⇩1 x)
⟹ (⋀x. ∃a. a ∈ D'⇩2 x ⟹ R⇩2 x ≡ R'⇩2 x)
⟹ (⋀f⇩1 f⇩2 P⇩1 P⇩2 x. Satisfiable (x ⦂ F1 T⇩1 T⇩2) ⟹ fm f⇩1 f⇩2 P⇩1 P⇩2 x ≡ fm' f⇩1 f⇩2 P⇩1 P⇩2 x)
⟹ (⋀f⇩1 f⇩2 P⇩1 P⇩2 x. Satisfiable (x ⦂ F1 T⇩1 T⇩2) ⟹ Satisfiable (fm' f⇩1 f⇩2 P⇩1 P⇩2 x ⦂ F2 U⇩1 U⇩2) ⟹ pm f⇩1 f⇩2 P⇩1 P⇩2 x ≡ pm' f⇩1 f⇩2 P⇩1 P⇩2 x)
⟹ Functional_Transformation_BiFunctor F1 F2 T⇩1 T⇩2 U⇩1 U⇩2 D⇩1 D⇩2 R⇩1 R⇩2 pm fm ≡
Functional_Transformation_BiFunctor F1 F2 T⇩1 T⇩2 U⇩1 U⇩2 D'⇩1 D'⇩2 R'⇩1 R'⇩2 pm' fm' ›
unfolding Functional_Transformation_BiFunctor_def atomize_eq Transformation_def Satisfiable_def
by (clarsimp, smt (verit, best))
paragraph ‹Parameterization›
private lemma φTA_FTF⇩Λ_rule:
‹ 𝗋EIF Ant Ant'
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ant' ⟹ Transformation_Functor⇩Λ F1 F2 T U D R mapper)
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ant' ⟹ Abstract_Domain (F1 T) P⇩T)
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ant' ⟹ Abstract_Domain (F2 U) P⇩U)
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ant' ⟹ Object_Equiv (F2 U) eq)
⟹ (𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ant' ⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (∀f P x y. P⇩T x ∧ P⇩U y ∧ mapper (λp a b. b = f p a ∧ P p a) x y ⟶ eq y (fm f P x) ∧ pm f P x))
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Functional_Transformation_Functor⇩Λ F1 F2 T U D R pm fm ›
unfolding Premise_def Action_Tag_def 𝗋EIF_def
using infer_FTF⇩Λ_from_FT⇩Λ by blast
private lemma φTA_FTF⇩Λ_deriver_cong:
‹ D ≡ D'
⟹ (⋀p x. ∃a. a ∈ D' p x ⟹ R p x ≡ R' p x)
⟹ (⋀f P x. Satisfiable (x ⦂ F1 T) ⟹ fm f P x ≡ fm' f P x)
⟹ (⋀f P x. Satisfiable (x ⦂ F1 T) ⟹ Satisfiable (fm' f P x ⦂ F2 U) ⟹ pm f P x ≡ pm' f P x)
⟹ Functional_Transformation_Functor⇩Λ F1 F2 T U D R pm fm ≡
Functional_Transformation_Functor⇩Λ F1 F2 T U D' R' pm' fm' ›
unfolding Functional_Transformation_Functor⇩Λ_def atomize_eq Transformation_def Satisfiable_def
by (clarsimp, smt (verit, del_insts))
ML_file ‹library/phi_type_algebra/transformation_functor.ML›
end
φproperty_deriver Transformation_Functor 110
for ( ‹Transformation_Functor _ _ _ _ _ _ _›
| ‹Transformation_BiFunctor _ _ _ _ _ _ _ _ _ _ _›
| ‹Transformation_Functor⇩Λ _ _ _ _ _ _ _›)
= ‹ Phi_Type_Derivers.transformation_functor ›
φproperty_deriver Functional_Transformation_Functor 111
for ( ‹Functional_Transformation_Functor _ _ _ _ _ _ _ _›
| ‹Functional_Transformation_BiFunctor _ _ _ _ _ _ _ _ _ _ _ _›
| ‹Functional_Transformation_Functor⇩Λ _ _ _ _ _ _ _ _›)
requires Transformation_Functor
= ‹Phi_Type_Derivers.functional_transformation_functor›
subsection ‹Separation Homo›
text ‹Note, as an instance of Commutativity of Type Operators, the names of ‹introduction rule›
and ‹elimination rule› are just reversed. It is intentional, because I really think those names
are more natural and we don't really have to force the consistency of the names between the two levels.›
context begin
paragraph ‹Normal›
private lemma φTA_SH⇩I_rule:
‹ (⋀z. Ant ⟹
(∀x y. (x,y) ∈ D ∧ w(x,y) = z
⟶ ((x ⦂ OPEN undefined (Fa T)) * (y ⦂ OPEN undefined (Fb U))
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z ⦂ MAKE undefined (Fc (T ∗ U)))) @tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Separation_Homo⇩I Fa Fb Fc T U D w ›
unfolding Separation_Homo⇩I_def φProd_expn' Action_Tag_def MAKE_def OPEN_def
by simp
private lemma φTA_SH⇩E_rule:
‹ (⋀z. Ant ⟹
(z ∈ D ⟶
(z ⦂ OPEN undefined (Fc (T ∗⇩𝒜 U))
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 uz z ⦂ NO_SIMP φProd (MAKE undefined (Ft T)) (MAKE undefined (Fu U)))
) @tag φTA_subgoal 𝒜simp)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Separation_Homo⇩E Ft Fu Fc T U D uz ›
unfolding Separation_Homo⇩E_def φProd_expn' Action_Tag_def Bubbling_def MAKE_def OPEN_def NO_SIMP_def
by simp
private lemma φTA_SH⇩I_rewr_IH:
‹Trueprop (Ant ⟶ (∀x y. P x y ⟶ ((x ⦂ OPEN undefined Ta) * (y ⦂ OPEN undefined Tb)
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z ⦂ MAKE undefined Tc)) @tag φTA_subgoal undefined)
≡ (⋀x y. Ant @tag φTA_ANT ⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 P x y ⟹ ((x ⦂ Ta) * (y ⦂ Tb) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z ⦂ Tc) @tag φTA_ToA_elim)›
unfolding Action_Tag_def atomize_imp atomize_all Premise_def OPEN_def MAKE_def
by (rule; blast)
text ‹This conditioned template is necessary because, see,
\<^prop>‹(∀x y. (x,y) ∈ D ∧ w(x,y) = z ⟶ ((y ⦂ Fb U) * (x ⦂ Fa T) 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z ⦂ Fc (T ∗ U)))›
\<^term>‹z› does not determine ‹x› and ‹y› during the reasoning phase and until the phase of proof obligation solving.
When there are multiple choices of such induction hypotheses, for sure, we can attempt every choice
exhaustively, but it multiplies the search branches and can harm the performance dramatically.
Update: perhaps, the conditioned template is not that necessary, because it doesn't really matter
when ‹x,y› are undetermined, as they are still constrained by conditions given to proof obligations.
The form of abstract objects should never matter. All syntactic information guiding the reasoning
should only be given from φ-type, while the syntax of abstract objects shouldn't bear any convention
nor expectation.
BTW, I think we have no way to circumvent the reasoning branches even enormous, because there is a
fallback always varifies the abstract object in the target to a schematic variable.
›
private lemma φTA_SH⇩E_rewr_IH:
‹Trueprop (Ant ⟶ CC ⟶ (z ⦂ OPEN undefined T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 uz ⦂ MAKE undefined U1 ∗ MAKE undefined U2)
@tag φTA_subgoal A)
≡ (Ant @tag φTA_ANT ⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 CC ⟹ z ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z' ⦂ U1 ∗ U2 𝗌𝗎𝖻𝗃 z'. z' = uz @tag A)›
unfolding Action_Tag_def atomize_imp atomize_all OPEN_def MAKE_def Premise_def
by simp
private lemma φTA_SH⇩I_DV_cong:
‹ D ≡ D'
⟹ z ≡ z'
⟹ Separation_Homo⇩I Ft Fu Fc T U D z ≡ Separation_Homo⇩I Ft Fu Fc T U D' z' ›
by simp
private lemma φTA_SH⇩E_DV_cong:
‹ u ≡ u'
⟹ Separation_Homo⇩E Ft Fu Fc T U D u ≡ Separation_Homo⇩E Ft Fu Fc T U D u' ›
by simp
paragraph ‹With Parameterization›
private lemma φTA_SH⇩Λ⇩I_rule:
‹ (⋀z. Ant ⟹
(∀x y. (x,y) ∈ D ∧ w(x,y) = z
⟶ ((x ⦂ OPEN undefined (Fa T)) * (y ⦂ OPEN undefined (Fb U))
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z ⦂ MAKE undefined (Fc (λp. T p ∗ U p))))
@tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Separation_Homo⇩Λ⇩I Fa Fb Fc T U D w ›
unfolding Separation_Homo⇩Λ⇩I_def φProd_expn' Action_Tag_def MAKE_def OPEN_def
by simp
private lemma φTA_SH⇩Λ⇩E_rule:
‹ (⋀z. Ant ⟹
(z ∈ D ⟶
(z ⦂ OPEN undefined (Fc (λp. T p ∗⇩𝒜 U p))
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 uz z ⦂ NO_SIMP φProd (MAKE undefined (Ft T)) (MAKE undefined (Fu U))))
@tag φTA_subgoal 𝒜simp)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Separation_Homo⇩Λ⇩E Ft Fu Fc T U D uz ›
unfolding Separation_Homo⇩Λ⇩E_def φProd_expn' Action_Tag_def Bubbling_def
MAKE_def OPEN_def NO_SIMP_def
by simp
private lemma φTA_SH⇩Λ⇩I_DV_cong:
‹ D ≡ D'
⟹ z ≡ z'
⟹ Separation_Homo⇩Λ⇩I Ft Fu Fc T U D z ≡ Separation_Homo⇩Λ⇩I Ft Fu Fc T U D' z' ›
by simp
private lemma φTA_SH⇩Λ⇩E_DV_cong:
‹ u ≡ u'
⟹ Separation_Homo⇩Λ⇩E Ft Fu Fc T U D u ≡ Separation_Homo⇩Λ⇩E Ft Fu Fc T U D u' ›
by simp
private lemma φTA_SH⇩E_rewr_pre:
‹ (Ant ⟹ CC ⟶(X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z ⦂ NO_SIMP φProd T U) @tag 𝒜)
≡ Trueprop (Ant ⟶ CC ⟶ (X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z ⦂ T ∗ U) @tag 𝒜) ›
unfolding atomize_imp Action_Tag_def NO_SIMP_def .
ML_file ‹library/phi_type_algebra/separation_homo.ML›
end
φproperty_deriver Separation_Homo⇩I 120
for (‹Separation_Homo⇩I _ _ _ _ _ _ _› | ‹Separation_Homo⇩Λ⇩I _ _ _ _ _ _ _›)
= ‹ Phi_Type_Derivers.separation_homo_I ›
φproperty_deriver Separation_Homo⇩E 121
for (‹Separation_Homo⇩E _ _ _ _ _ _ _› | ‹Separation_Homo⇩Λ⇩E _ _ _ _ _ _ _›)
= ‹ Phi_Type_Derivers.separation_homo_E ›
φproperty_deriver Separation_Homo 122 requires Separation_Homo⇩I and Separation_Homo⇩E
φproperty_deriver Sep_Functor 130
requires Separation_Homo
and Functional_Transformation_Functor
and Basic
φproperty_deriver Sep_Functor_1 131
requires Sep_Functor
and Identity_Elements
and Identity_Element_Properties
subsection ‹Congruence in Function Definition›
lemma function_congruence_template:
‹ (𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x = y ∧ (∀a ∈ D x. T a = U a) ∧ eqs ⟹ Transformation_Functor F F' T U D R M)
⟹ (𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x = y ∧ (∀a ∈ D x. T a = U a) ∧ eqs ⟹ Transformation_Functor F' F U T D' R' M')
⟹ (𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x = y ∧ (∀a ∈ D x. T a = U a) ∧ eqs ⟹ Object_Equiv (F' U) eq')
⟹ (𝗉𝗋𝖾𝗆𝗂𝗌𝖾 x = y ∧ (∀a ∈ D x. T a = U a) ∧ eqs ⟹ Object_Equiv (F T) eq)
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 (x = y ∧ eqs ⟶
D x ⊆ R x ∧ (∀x y. M (=) x y ⟶ eq' y x) ∧ (∀x. D x = D' x) ∧
D' y ⊆ R' y ∧ (∀x y. M' (=) y x ⟶ eq x y))
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ eqs
⟹ x = y
⟹ (⋀a. a ∈ D y ⟹ T a = U a)
⟹ F T x = F' U y ›
unfolding fun_eq_iff[symmetric, where f=D]
unfolding Transformation_Functor_def Premise_def Transformation_def φType_def BI_eq_iff
subset_iff meta_Ball_def Ball_def Object_Equiv_def
apply clarify
subgoal premises prems for u
by (insert prems(1)[THEN spec[where x=y], THEN spec[where x=‹(=)›]]
prems(2)[THEN spec[where x=y], THEN spec[where x=‹(=)›]]
prems(3-);
clarsimp; rule; meson) .
subsection ‹Configuration for guessing default Semimodule properties›
definition Guess_Scalar_Zero :: ‹ 's itself ⇒ 'c::one itself ⇒ 'a itself
⇒ ('s ⇒ ('c,'a) φ)
⇒ ('s ⇒ ('c,'a) φ)
⇒ 's
⇒ bool ⇒ bool
⇒ bool ›
where ‹Guess_Scalar_Zero _ _ _ F unfolded_F zero ants conds ≡ True›
definition Guess_Scalar_One⇩I :: ‹ 's itself ⇒ 'c⇩T itself ⇒ 'c itself ⇒ 'a⇩T itself ⇒'a itself
⇒ ('s ⇒ ('c,'a) φ)
⇒ ('s ⇒ ('c,'a) φ)
⇒ ('c⇩T,'a⇩T) φ
⇒ ('c,'a⇩1) φ
⇒ 's ⇒ ('a⇩1 ⇒ bool) ⇒ ('a⇩1 ⇒ 'a) ⇒ ('a⇩1 ⇒ bool)
⇒ bool ⇒ bool
⇒ bool ›
where ‹Guess_Scalar_One⇩I _ _ _ _ _ F unfolded_F T T⇩1 one Dx f P ants conds ≡ True›
definition Guess_Scalar_One⇩E :: ‹ 's itself ⇒ 'c⇩T itself ⇒ 'c itself ⇒ 'a⇩T itself => 'a itself
⇒ ('s ⇒ ('c,'a) φ)
⇒ ('s ⇒ ('c,'a) φ)
⇒ ('c⇩T,'a⇩T) φ
⇒ ('c,'a⇩1) φ
⇒ 's ⇒ ('a ⇒ bool) ⇒ ('a ⇒ 'a⇩1) ⇒ ('a ⇒ bool)
⇒ bool ⇒ bool
⇒ bool ›
where ‹Guess_Scalar_One⇩E _ _ _ _ _ F unfolded_F T T⇩1 one Dx f P ants conds ≡ True›
definition Guess_Scalar_Assoc⇩I :: ‹ 's⇩c itself ⇒ 'c itself ⇒ 'c⇩s⇩t itself ⇒ 'a itself ⇒ 'a⇩s⇩t itself
⇒ ('s⇩s ⇒ ('c⇩t,'a⇩t) φ ⇒ ('c⇩s⇩t,'a⇩s⇩_⇩t) φ)
⇒ ('s⇩t ⇒ ('c,'a) φ ⇒ ('c⇩t,'a⇩t) φ)
⇒ ('s⇩c ⇒ ('c,'a) φ ⇒ ('c⇩s⇩t,'a⇩s⇩t) φ)
⇒ ('s⇩c ⇒ ('c,'a) φ ⇒ ('c⇩s⇩t,'a⇩s⇩t) φ)
⇒ ('c,'a) φ
⇒ ('s⇩s ⇒ bool)
⇒ ('s⇩t ⇒ bool)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 'a⇩s⇩_⇩t ⇒ bool)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 's⇩c)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 'a⇩s⇩_⇩t ⇒ 'a⇩s⇩t)
⇒ bool ⇒ bool
⇒ bool›
where ‹Guess_Scalar_Assoc⇩I _ _ _ _ _ Fs Ft Fc unfolded_Fc T Ds Dt Dx smul f ants conds ≡ True›
definition Guess_Scalar_Assoc⇩E :: ‹ 's⇩c itself ⇒ 'c itself ⇒ 'c⇩s⇩t itself ⇒ 'a itself ⇒ 'a⇩s⇩t itself
⇒ ('s⇩s ⇒ ('c⇩t,'a⇩t) φ ⇒ ('c⇩s⇩t,'a⇩s⇩_⇩t) φ)
⇒ ('s⇩t ⇒ ('c,'a) φ ⇒ ('c⇩t,'a⇩t) φ)
⇒ ('s⇩c ⇒ ('c,'a) φ ⇒ ('c⇩s⇩t,'a⇩s⇩t) φ)
⇒ ('s⇩c ⇒ ('c,'a) φ ⇒ ('c⇩s⇩t,'a⇩s⇩t) φ)
⇒ ('c,'a) φ
⇒ ('s⇩s ⇒ bool)
⇒ ('s⇩t ⇒ bool)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 'a⇩s⇩t ⇒ bool)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 's⇩c)
⇒ ('s⇩s ⇒ 's⇩t ⇒ 'a⇩s⇩t ⇒ 'a⇩s⇩_⇩t)
⇒ bool ⇒ bool
⇒ bool›
where ‹Guess_Scalar_Assoc⇩E _ _ _ _ _ Fs Ft Fc unfolded_Fc T Ds Dt Dx smul f ants conds ≡ True›
definition Guess_Zip_of_Semimodule :: ‹'s itself ⇒ ('c::sep_magma) itself ⇒ 'a itself
⇒ ('s ⇒ ('c,'a) φ)
⇒ ('s ⇒ ('c,'a) φ)
⇒ ('s ⇒ bool)
⇒ ('s ⇒ 's ⇒ 'a × 'a ⇒ bool)
⇒ ('s ⇒ 's ⇒ 'a × 'a ⇒ 'a)
⇒ bool ⇒ bool
⇒ bool›
where ‹Guess_Zip_of_Semimodule type_scalar type_concrete type_abstract
F unfolded_F_def
domain_of_scalar domain_of_abstract zip_opr
antecedents conditions_of_antecedents
≡ True›
definition Guess_Unzip_of_Semimodule :: ‹'s itself ⇒ 'c itself ⇒ 'a itself
⇒ ('s ⇒ ('c,'a) φ)
⇒ ('s ⇒ ('c,'a) φ)
⇒ ('s ⇒ bool)
⇒ ('s ⇒ 's ⇒ 'a ⇒ bool)
⇒ ('s ⇒ 's ⇒ 'a ⇒ 'a × 'a)
⇒ bool ⇒ bool
⇒ bool›
where ‹Guess_Unzip_of_Semimodule type_scalar type_concrete type_abstract
F unfolded_typ_def
domain_of_scalar domain_of_abstract unzip_opr
antecedents conditions_of_antecedents
≡ True›
declare [[ φreason_default_pattern
‹Guess_Scalar_Zero ?S ?C ?A _ ?def _ _ _› ⇒
‹Guess_Scalar_Zero ?S ?C ?A _ ?def _ _ _› (100)
and ‹Guess_Scalar_One⇩I ?S ?C⇩T ?C ?A⇩T ?A _ ?def ?T _ _ _ _ _ _ _› ⇒
‹Guess_Scalar_One⇩I ?S ?C⇩T ?C ?A⇩T ?A _ ?def ?T _ _ _ _ _ _ _› (100)
and ‹Guess_Scalar_One⇩E ?S ?C⇩T ?C ?A⇩T ?A _ ?def ?T _ _ _ _ _ _ _› ⇒
‹Guess_Scalar_One⇩E ?S ?C⇩T ?C ?A⇩T ?A _ ?def ?T _ _ _ _ _ _ _› (100)
and ‹Guess_Zip_of_Semimodule ?S ?C ?A _ ?def _ _ _ _ _› ⇒
‹Guess_Zip_of_Semimodule ?S ?C ?A _ ?def _ _ _ _ _› (100)
and ‹Guess_Unzip_of_Semimodule ?S ?C ?A _ ?def _ _ _ _ _› ⇒
‹Guess_Unzip_of_Semimodule ?S ?C ?A _ ?def _ _ _ _ _› (100)
and ‹Guess_Scalar_Assoc⇩I ?S ?C⇩T ?C ?A⇩T ?A⇩F _ _ _ ?def ?T _ _ _ _ _ _ _› ⇒
‹Guess_Scalar_Assoc⇩I ?S ?C⇩T ?C ?A⇩T ?A⇩F _ _ _ ?def ?T _ _ _ _ _ _ _› (100)
and ‹Guess_Scalar_Assoc⇩E ?S ?C⇩T ?C ?A⇩T ?A⇩F _ _ _ ?def ?T _ _ _ _ _ _ _› ⇒
‹Guess_Scalar_Assoc⇩E ?S ?C⇩T ?C ?A⇩T ?A⇩F _ _ _ ?def ?T _ _ _ _ _ _ _› (100)
]]
text ‹Guessing the zip operation of a semimodule is far beyond what can be inferred from BNF,
partially because a semimodule is over two algebraic sorts (i.e., two logical types).
Due to this, the guessing of the abstract operators of semimodules more relies on pre-registered
records over the logical types.›
paragraph ‹Initialization›
lemma [φreason %φTA_guesser_init]:
‹ (⋀s x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_unfolded_F s x) : (x ⦂ F s) )
⟹ Guess_Scalar_Zero TS TC TA F var_unfolded_F z ants conds
⟹ Guess_Scalar_Zero TS TC TA F var_unfolded_F z ants conds› .
lemma [φreason %φTA_guesser_init]:
‹ (⋀s x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_unfolded_F s x) : (x ⦂ F s) )
⟹ Guess_Scalar_One⇩I TS TC⇩T TC TA⇩T TA F var_unfolded_F T T⇩1 one Dx f P ants conds
⟹ Guess_Scalar_One⇩I TS TC⇩T TC TA⇩T TA F var_unfolded_F T T⇩1 one Dx f P ants conds› .
lemma [φreason %φTA_guesser_init]:
‹ (⋀s x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_unfolded_F s x) : (x ⦂ F s) )
⟹ Guess_Scalar_One⇩E TS TC⇩T TC TA⇩T TA F var_unfolded_F T T⇩1 one Dx f P ants conds
⟹ Guess_Scalar_One⇩E TS TC⇩T TC TA⇩T TA F var_unfolded_F T T⇩1 one Dx f P ants conds› .
lemma [φreason %φTA_guesser_init]:
‹ (⋀s T x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_unfolded_Fc s T x) : (x ⦂ Fc s T) )
⟹ Guess_Scalar_Assoc⇩I TS TC TC' TA⇩T TA Fs Ft Fc var_unfolded_Fc T Ds Dt Dx smul f ants conds
⟹ Guess_Scalar_Assoc⇩I TS TC TC' TA⇩T TA Fs Ft Fc var_unfolded_Fc T Ds Dt Dx smul f ants conds› .
lemma [φreason %φTA_guesser_init]:
‹ (⋀s T x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_unfolded_Fc s T x) : (x ⦂ Fc s T) )
⟹ Guess_Scalar_Assoc⇩E TS TC TC' TA⇩T TA Fs Ft Fc var_unfolded_Fc T Ds Dt Dx smul f ants conds
⟹ Guess_Scalar_Assoc⇩E TS TC TC' TA⇩T TA Fs Ft Fc var_unfolded_Fc T Ds Dt Dx smul f ants conds› .
lemma [φreason %φTA_guesser_init]:
‹ (⋀s x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_unfolded_F s x) : (x ⦂ F s) )
⟹ Guess_Zip_of_Semimodule TS TC TA F var_unfolded_F Ds Dx z ants conds
⟹ Guess_Zip_of_Semimodule TS TC TA F var_unfolded_F Ds Dx z ants conds› .
lemma [φreason %φTA_guesser_init]:
‹ (⋀s x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_unfolded_F s x) : (x ⦂ F s) )
⟹ Guess_Unzip_of_Semimodule TS TC TA F var_unfolded_F Ds Dx z ants conds
⟹ Guess_Unzip_of_Semimodule TS TC TA F var_unfolded_F Ds Dx z ants conds› .
paragraph ‹Guess_Scalar_Zero›
lemma [φreason %φTA_guesser_fallback]:
‹Guess_Scalar_Zero TYPE('s::zero) TYPE('c::one) TYPE('a)
F unfolded_F 0 True True ›
unfolding Guess_Scalar_Zero_def ..
lemma [φreason %φTA_guesser_default]:
‹Guess_Scalar_Zero TYPE('s len_intvl) TYPE('c::one) TYPE('a list)
F unfolded_F ⟦x:0⦆ True True›
unfolding Guess_Scalar_Zero_def ..
paragraph ‹Guess_Scalar_One›
lemma [φreason %φTA_guesser_fallback]:
‹Guess_Scalar_One⇩I TYPE('s::one) TYPE('c) TYPE('c) TYPE('a) TYPE('a)
F whatever T T 1 (λ_. True) (λx. x) (λ_. True) True True›
unfolding Guess_Scalar_One⇩I_def ..
lemma [φreason %φTA_guesser_fallback]:
‹Guess_Scalar_One⇩E TYPE('s::one) TYPE('c) TYPE('c) TYPE('a) TYPE('a)
F whatever T T 1 (λ_. True) (λx. x) (λ_. True) True True›
unfolding Guess_Scalar_One⇩E_def ..
lemma [φreason %φTA_guesser_default]:
‹Guess_Scalar_One⇩I TYPE('s len_intvl) TYPE('c) TYPE('c) TYPE('a) TYPE('a list)
F whatever T T ⟦x:1⦆ (λ_. True) (λx. [x]) (λ_. True) True True›
unfolding Guess_Scalar_One⇩I_def ..
lemma [φreason %φTA_guesser_default]:
‹Guess_Scalar_One⇩E TYPE('s len_intvl) TYPE('c) TYPE('c) TYPE('a) TYPE('a list)
F whatever T T ⟦x:1⦆ (λl. length l = 1) hd (λ_. True) True True›
unfolding Guess_Scalar_One⇩E_def ..
lemma [φreason %φTA_guesser_default]:
‹Guess_Scalar_One⇩I TYPE('i set) TYPE('c) TYPE('c::sep_algebra) TYPE('a) TYPE('i ⇒ 'a)
F (λs x. ✱ (A s x) s) T T {i} (λ_. True) (λx _. x) (λ_. True) True True›
unfolding Guess_Scalar_One⇩I_def ..
lemma [φreason %φTA_guesser_default]:
‹Guess_Scalar_One⇩E TYPE('i set) TYPE('c) TYPE('c::sep_algebra) TYPE('a) TYPE('i ⇒ 'a)
F (λs x. ✱ (A s x) s) T T {i} (λ_. True) (λf. f i) (λ_. True) True True›
unfolding Guess_Scalar_One⇩E_def ..
paragraph ‹Guess_Scalar_Assoc›
lemma [φreason %φTA_guesser_default[bottom]]:
‹Guess_Scalar_Assoc⇩I TYPE('s::times) TYPE('c) TYPE('c) TYPE('a) TYPE('a)
F F F whatever T (λ_. True) (λ_. True) (λ_ _ _. True) (*) (λ_ _ x. x) True True›
unfolding Guess_Scalar_Assoc⇩I_def ..
lemma [φreason %φTA_guesser_default]:
‹Guess_Scalar_Assoc⇩I TYPE(rat) TYPE('c::share) TYPE('c) TYPE('a) TYPE('a)
F F F whatever T ((<) 0) ((<) 0) (λ_ _ _. True) (*) (λ_ _ x. x) True True›
unfolding Guess_Scalar_Assoc⇩I_def ..
lemma [φreason %φTA_guesser_default+1]:
‹Guess_Scalar_Assoc⇩I TYPE(rat) TYPE('c::share_one) TYPE('c) TYPE('a) TYPE('a)
F F F whatever T ((≤) 0) ((≤) 0) (λ_ _ _. True) (*) (λ_ _ x. x) True True›
unfolding Guess_Scalar_Assoc⇩I_def ..
lemma [φreason %φTA_guesser_default[bottom]]:
‹Guess_Scalar_Assoc⇩E TYPE('s::times) TYPE('c) TYPE('c) TYPE('a) TYPE('a)
F F F whatever T (λ_. True) (λ_. True) (λ_ _ _. True) (*) (λ_ _ x. x) True True›
unfolding Guess_Scalar_Assoc⇩E_def ..
lemma [φreason %φTA_guesser_default]:
‹Guess_Scalar_Assoc⇩E TYPE(rat) TYPE('c::share) TYPE('c) TYPE('a) TYPE('a)
F F F whatever T ((<) 0) ((<) 0) (λ_ _ _. True) (*) (λ_ _ x. x) True True›
unfolding Guess_Scalar_Assoc⇩E_def ..
lemma [φreason %φTA_guesser_default+1]:
‹Guess_Scalar_Assoc⇩E TYPE(rat) TYPE('c::share_one) TYPE('c) TYPE('a) TYPE('a)
F F F whatever T ((≤) 0) ((≤) 0) (λ_ _ _. True) (*) (λ_ _ x. x) True True›
unfolding Guess_Scalar_Assoc⇩E_def ..
lemma [φreason %φTA_guesser_default for
‹Guess_Scalar_Assoc⇩I TYPE(_ set) TYPE(_) TYPE(_) TYPE(_) TYPE(_) _ _ _ (λs T x. ✱ (?A s T x) s) _
_ _ _ _ _ _ _›]:
‹ Type_Variant_of_the_Same_Scalar_Mul Fc Fs
⟹ Type_Variant_of_the_Same_Scalar_Mul Fc Ft
⟹ Guess_Scalar_Assoc⇩I TYPE(('i × 'j) set) TYPE('c::sep_algebra) TYPE('c) TYPE('a) TYPE('i × 'j ⇒ 'a)
Fs Ft Fc (λs T x. ✱ (A s T x) s) T (λ_. True) (λ_. True) (λ_ _ _. True)
(×) (λ_ _. case_prod) True True ›
unfolding Guess_Scalar_Assoc⇩I_def ..
lemma [φreason %φTA_guesser_default for
‹Guess_Scalar_Assoc⇩E TYPE(_ set) TYPE(_) TYPE(_) TYPE(_) TYPE(_) _ _ _ (λs T x. ✱ (?A s T x) s) _
_ _ _ _ _ _ _›]:
‹ Type_Variant_of_the_Same_Scalar_Mul Fc Fs
⟹ Type_Variant_of_the_Same_Scalar_Mul Fc Ft
⟹ Guess_Scalar_Assoc⇩E TYPE(('i × 'j) set) TYPE('c::sep_algebra) TYPE('c) TYPE('a) TYPE('i × 'j ⇒ 'a)
Fs Ft Fc (λs T x. ✱ (A s T x) s) T finite finite (λ_ _ _. True)
(×) (λ_ _. curry) True True ›
unfolding Guess_Scalar_Assoc⇩E_def ..
paragraph ‹Guess_(Un)Zip_of_Semimodule›
lemma [φreason %φTA_guesser_default]:
‹Guess_Zip_of_Semimodule TYPE(rat) TYPE('c::sep_magma) TYPE('a)
F any
(λx. 0 ≤ x) (λ_ _ (x,y). x = y) (λ_ _ (x,y). x)
True True ›
unfolding Guess_Zip_of_Semimodule_def ..
lemma [φreason %φTA_guesser_default]:
‹Guess_Unzip_of_Semimodule TYPE(rat) TYPE('c::sep_magma) TYPE('a)
F any
(λx. 0 ≤ x) (λ_ _ x. True) (λ_ _ x. (x,x))
True True ›
unfolding Guess_Unzip_of_Semimodule_def ..
lemma [φreason %φTA_guesser_default]:
‹Guess_Zip_of_Semimodule TYPE(nat lcro_intvl) TYPE('c::sep_magma) TYPE('a list)
F any (λ_. True)
(λs t (x,y). LCRO_Interval.width_of s = length x ∧ LCRO_Interval.width_of t = length y)
(λ_ _ (x,y). x @ y)
True True›
unfolding Guess_Zip_of_Semimodule_def ..
lemma [φreason %φTA_guesser_default]:
‹Guess_Unzip_of_Semimodule TYPE(nat lcro_intvl) TYPE('c::sep_magma) TYPE('a list)
F any (λ_. True)
(λs t x. LCRO_Interval.width_of s + LCRO_Interval.width_of t = length x)
(λs t x. (take (LCRO_Interval.width_of s) x, drop (LCRO_Interval.width_of s) x))
True True›
unfolding Guess_Unzip_of_Semimodule_def ..
lemma [φreason %φTA_guesser_default]:
‹Guess_Zip_of_Semimodule TYPE('s len_intvl) TYPE('c::sep_magma) TYPE('a list)
F any (λ_. True)
(λs t (x,y). length x = len_intvl.len s ∧ length y = len_intvl.len t)
(λ_ _ (x,y). x @ y)
True True›
unfolding Guess_Zip_of_Semimodule_def ..
lemma [φreason %φTA_guesser_default]:
‹Guess_Unzip_of_Semimodule TYPE('s len_intvl) TYPE('c::sep_magma) TYPE('a list)
F any (λ_. True)
(λs t x. length x = len_intvl.len s + len_intvl.len t)
(λs t x. (take (len_intvl.len s) x, drop (len_intvl.len s) x))
True True›
unfolding Guess_Unzip_of_Semimodule_def ..
lemma [φreason %φTA_guesser_default]:
‹Guess_Zip_of_Semimodule TYPE('i set) TYPE('c::sep_algebra) TYPE('i ⇒ 'a)
F (λs x. ✱ (A s x) s)
(λ_. True) (λ_ _ _. True) (λ_ D⇩g (f,g). f ⊕⇩f[D⇩g] g) True True ›
unfolding Guess_Zip_of_Semimodule_def ..
lemma [φreason %φTA_guesser_default]:
‹Guess_Unzip_of_Semimodule TYPE('i set) TYPE('c::sep_algebra) TYPE('i ⇒ 'a)
F (λs x. ✱ (A s x) s)
(λ_. True) (λ_ _ _. True) (λ_ _ f. (f,f)) True True ›
unfolding Guess_Unzip_of_Semimodule_def ..
paragraph ‹ML Library›
ML_file ‹library/phi_type_algebra/guess_semimodule.ML›
subsection ‹Semimodule Scalar Zero›
context begin
private lemma φTA_M0_rule:
‹ (⋀x. Ant ⟹ Identity_Element⇩I (x ⦂ OPEN undefined (F zero)) True
@tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Module_Zero F zero ›
unfolding Module_Zero_def Action_Tag_def Premise_def
Identity_Element⇩I_def Identity_Element⇩E_def OPEN_def
by (clarsimp simp add: BI_eq_iff Transformation_def; blast)
private lemma φTA_M0c_rule:
‹ (⋀x. Ant ⟹ Identity_Element⇩E (x ⦂ MAKE undefined (F zero))
@tag φTA_subgoal undefined)
⟹ Module_Zero F zero
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Closed_Module_Zero F zero ›
unfolding Module_Zero_def Action_Tag_def Premise_def Identity_Element⇩I_def Identity_Element⇩E_def
Closed_Module_Zero_def MAKE_def
by (clarsimp simp add: BI_eq_iff Transformation_def; blast)
private lemma φTA_M0_rewr_IH:
‹ Trueprop (Ant ⟶ Identity_Element⇩I (x ⦂ OPEN undefined T) True @tag φTA_subgoal A)
≡ (Ant ⟹ Identity_Element⇩I (x ⦂ T) True ) ›
unfolding Action_Tag_def atomize_imp OPEN_def .
private lemma φTA_M0c_rewr_IH:
‹ Trueprop (Ant ⟶ Identity_Element⇩E (x ⦂ MAKE undefined T) @tag φTA_subgoal A)
≡ (Ant ⟹ Identity_Element⇩E (x ⦂ T) ) ›
unfolding Action_Tag_def atomize_imp MAKE_def .
ML_file ‹library/phi_type_algebra/Module_Zero.ML›
end
φproperty_deriver Module_Zero 129 for (‹Module_Zero _ _›)
= ‹Phi_Type_Derivers.Module_Zero›
φproperty_deriver Closed_Module_Zero 130
for (‹Closed_Module_Zero _ _›)
requires Module_Zero
= ‹Phi_Type_Derivers.closed_Module_Zero›
subsection ‹Semimodule Scalar Identity›
context begin
private lemma φTA_MI⇩E_rule:
‹ (⋀x. Ant
⟶ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 D x
⟶ (x ⦂ F one 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f x ⦂ T⇩1 𝗐𝗂𝗍𝗁 P⇩E x) @tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Module_One⇩E F T⇩1 one D f P⇩E ›
unfolding Module_One⇩E_def Action_Tag_def Premise_def Transformation_def
by (clarsimp; metis)
private lemma φTA_MI⇩I_rule:
‹ (⋀x. Ant
⟶ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 D x
⟶ (x ⦂ T⇩1 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f x ⦂ F one 𝗐𝗂𝗍𝗁 P⇩I x) @tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Module_One⇩I F T⇩1 one D f P⇩I ›
unfolding Module_One⇩I_def Action_Tag_def Premise_def Transformation_def
by (clarsimp; metis)
ML_file ‹library/phi_type_algebra/semimodule_identity.ML›
end
φproperty_deriver Module_One⇩I 130 for (‹Module_One⇩I _ _ _ _ _ _›)
= ‹Phi_Type_Derivers.semimodule_identity_I›
φproperty_deriver Module_One⇩E 130 for (‹Module_One⇩E _ _ _ _ _ _›)
= ‹Phi_Type_Derivers.semimodule_identity_E›
φproperty_deriver Module_One 131
requires Module_One⇩I and Module_One⇩E
subsection ‹Semimodule Scalar Associative›
text ‹φ-type embedding of separation quantifier ‹x ⦂ ✱[i∈I] T› is a recursive example of this.
The induction of the φ-type should expand the scalar as the scalar usually represents the domain of the φ-type abstraction.
›
context begin
private lemma φTA_MS⇩I_rule:
‹ (⋀t s x r y. Ant
⟶ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ds s ∧ Dt t ∧ Dx s t x ∧ r = smul s t ∧ f s t x = y
⟶ (x ⦂ OPEN undefined (Fs s (OPEN undefined (Ft t T)))
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ MAKE undefined (Fc r T)) @tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Module_Assoc⇩I Fs Ft Fc T Ds Dt Dx smul f ›
unfolding Module_Assoc⇩I_def Action_Tag_def Premise_def MAKE_def OPEN_def
by clarsimp
private lemma φTA_MS⇩E_rule:
‹ (⋀t s r x. Ant
⟶ 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 Ds s ∧ Dt t ∧ r = smul s t ∧ Dx s t x
⟶ (x ⦂ OPEN undefined (Fc r T)
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 f s t x ⦂ MAKE undefined (Fs s (MAKE undefined (Ft t T))))
@tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Module_Assoc⇩E Fs Ft Fc T Ds Dt Dx smul f ›
unfolding Module_Assoc⇩E_def Action_Tag_def Premise_def MAKE_def OPEN_def
by clarsimp
private lemma φTA_MS⇩I_rewr_IH:
‹ Trueprop (Ant ⟶ C ⟶ (x ⦂ OPEN undefined U 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ MAKE undefined T 𝗐𝗂𝗍𝗁 P) @tag A)
≡ (Ant ⟹ C ⟹ x ⦂ U 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ φTA_IND_TARGET T 𝗐𝗂𝗍𝗁 P) ›
unfolding Action_Tag_def atomize_imp φTA_IND_TARGET_def OPEN_def MAKE_def .
ML_file ‹library/phi_type_algebra/semimodule_scalar.ML›
end
φproperty_deriver Module_Assoc⇩I 130 for (‹Module_Assoc⇩I _ _ _ _ _ _ _ _ _›)
= ‹Phi_Type_Derivers.semimodule_assoc_I›
φproperty_deriver Module_Assoc⇩E 130 for (‹Module_Assoc⇩E _ _ _ _ _ _ _ _ _›)
= ‹Phi_Type_Derivers.semimodule_assoc_E›
φproperty_deriver Module_Assoc 131
requires Module_Assoc⇩I and Module_Assoc⇩E
φproperty_deriver Semimodule_NonDistr_no0 132
requires Module_Assoc and Module_One
and Semimodule_No_SDistr
φproperty_deriver Semimodule_NonDistr 133
requires Semimodule_NonDistr_no0 and Module_Zero
subsection ‹Semimodule Scalar Distributivity - Zip›
context begin
bundle φTA_MD =
[[φreason_default_pattern ‹equation⇩2⇩1 ?c ?a ?b› ⇒ ‹equation⇩2⇩1 _ _ _› (1000)]]
φreasoner_group 𝒜_partial_add_local = (3850, [3850, 3850]) in 𝒜_partial_add__top ‹›
private lemma φTA_MD⇩Z_rule:
‹ (⋀s t x r z. Ant
⟹ equation⇩3⇩1_cond False True unspec s s t r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 Ds s ∧ Ds t ∧ Dx s t x ∧ zi s t x = z
⟹ (x ⦂ NO_SIMP φProd (OPEN undefined (F s)) (OPEN undefined (F t))
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 z ⦂ MAKE undefined (F r))
@tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Module_Distr_Homo⇩Z F Ds Dx zi ›
unfolding Module_Distr_Homo⇩Z_def Action_Tag_def Premise_def Transformation_def
OPEN_def MAKE_def NO_SIMP_def equation⇩3⇩1_cond_def
by clarsimp
private lemma φTA_MD⇩U_rule:
‹ (⋀s t r x. Ant
⟹ equation⇩3⇩1_cond False True unspec s s t r
⟹ 𝗉𝗋𝖾𝗆𝗂𝗌𝖾 Ds s ∧ Ds t ∧ Dx s t x
⟹ (x ⦂ OPEN undefined (F r)
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 uz s t x ⦂ NO_SIMP φProd (MAKE undefined (F s)) (MAKE undefined (F t)))
@tag φTA_subgoal (to (𝗍𝗋𝖺𝗏𝖾𝗋𝗌𝖾 𝗉𝖺𝗍𝗍𝖾𝗋𝗇 F r ⇒ 𝗌𝗉𝗅𝗂𝗍-𝗌𝖼𝖺𝗅𝖺𝗋 s t)))
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Module_Distr_Homo⇩S F Ds Dx uz ›
unfolding Module_Distr_Homo⇩S_def Action_Tag_def Premise_def Transformation_def
OPEN_def MAKE_def NO_SIMP_def equation⇩3⇩1_cond_def
by clarsimp
private lemma φTA_MD⇩U_cong:
‹ Ds ≡ Ds'
⟹ (⋀t s x. Ds' t ⟹ Ds' s ⟹ s ##⇩+ t ⟹ Dx s t x ≡ Dx' s t x)
⟹ (⋀t s x. Ds' t ⟹ Ds' s ⟹ s ##⇩+ t ⟹ Dx' s t x ⟹ uz s t x ≡ uz' s t x)
⟹ Module_Distr_Homo⇩S F Ds Dx uz ≡ Module_Distr_Homo⇩S F Ds' Dx' uz' ›
unfolding Module_Distr_Homo⇩S_def atomize_eq Transformation_def
by clarsimp metis
private lemma φTA_MD⇩Z_cong:
‹ Ds ≡ Ds'
⟹ (⋀t s x. Ds' t ⟹ Ds' s ⟹ s ##⇩+ t ⟹ Dx s t x ≡ Dx' s t x)
⟹ (⋀t s x. Ds' t ⟹ Ds' s ⟹ s ##⇩+ t ⟹ Dx' s t x ⟹ z s t x ≡ z' s t x)
⟹ Module_Distr_Homo⇩Z F Ds Dx z ≡ Module_Distr_Homo⇩Z F Ds' Dx' z' ›
unfolding Module_Distr_Homo⇩Z_def atomize_eq Transformation_def
by (auto; metis)
private lemma φTA_MD⇩Z_rewr_IH:
‹ Trueprop (Ant ⟶ C2 ⟶ C ⟶ (x ⦂ OPEN undefined U⇩1 ∗ OPEN undefined U⇩2
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ MAKE undefined T 𝗐𝗂𝗍𝗁 P) @tag A)
≡ (Ant @tag φTA_ANT ⟹ C2 ⟹ C ⟹ x ⦂ U⇩1 ∗ U⇩2 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ φTA_IND_TARGET T 𝗐𝗂𝗍𝗁 P @tag φTA_ToA_elim) ›
unfolding Action_Tag_def atomize_imp φTA_IND_TARGET_def OPEN_def MAKE_def .
private lemma φTA_MD⇩U_rewr_IH:
‹ Trueprop (Ant ⟶ C2 ⟶ C ⟶ (x ⦂ OPEN undefined T
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ MAKE undefined U⇩1 ∗ MAKE undefined U⇩2 𝗐𝗂𝗍𝗁 P) @tag φTA_subgoal (to (𝗍𝗋𝖺𝗏𝖾𝗋𝗌𝖾 𝗉𝖺𝗍𝗍𝖾𝗋𝗇 AA ⇒ A)))
≡ (Ant @tag φTA_ANT ⟹ C2 ⟹ C ⟹ x ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ U⇩1 ∗ U⇩2 𝗐𝗂𝗍𝗁 P @tag (to A)) ›
unfolding Action_Tag_def atomize_imp φTA_IND_TARGET_def OPEN_def MAKE_def .
private lemma φTA_MD⇩Z_rewr_pre:
‹ (Ant ⟹ C2 ⟹ C ⟹ x ⦂ NO_SIMP φProd T U 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P @tag 𝒜)
≡ Trueprop (Ant ⟶ C2 ⟶ C ⟶ (x ⦂ T ∗ U 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 Y 𝗐𝗂𝗍𝗁 P) @tag 𝒜) ›
unfolding atomize_imp Action_Tag_def NO_SIMP_def .
private lemma φTA_MD⇩U_rewr_pre:
‹ (Ant ⟹ C2 ⟹ C ⟹ X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ NO_SIMP φProd T U 𝗐𝗂𝗍𝗁 P @tag 𝒜)
≡ Trueprop (Ant ⟶ C2 ⟶ C ⟶ (X 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 x ⦂ T ∗ U 𝗐𝗂𝗍𝗁 P) @tag 𝒜) ›
unfolding atomize_imp Action_Tag_def NO_SIMP_def .
ML_file ‹library/phi_type_algebra/semimodule_distrib_zip.ML›
end
φproperty_deriver Module_Distr_Homo⇩Z 130 for (‹Module_Distr_Homo⇩Z _ _ _ _›)
= ‹Phi_Type_Derivers.semimodule_distrib_zip›
φproperty_deriver Module_Distr_Homo⇩S 130 for (‹Module_Distr_Homo⇩S _ _ _ _›)
= ‹Phi_Type_Derivers.semimodule_distrib_unzip›
φproperty_deriver Module_Distr_Homo 131
requires Module_Distr_Homo⇩Z and Module_Distr_Homo⇩S
φproperty_deriver Semimodule_NonAssoc 132
requires Module_Distr_Homo and Module_Zero
and Module_One
φproperty_deriver Semimodule_no0 133
requires Module_Assoc and Module_One
and Module_Distr_Homo
φproperty_deriver Semimodule 134
requires Semimodule_no0 and Module_Zero
subsection ‹Construct Abstraction from Concrete Representation (by Itself)›
context begin
private lemma φTA_TrCstr_rule:
‹ Ant ⟶ (c ⦂ Itself 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 A) @tag φTA_subgoal undefined
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ c ⦂ Itself 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 A ›
unfolding Action_Tag_def
by simp
ML_file ‹library/phi_type_algebra/constr_abst_weak.ML›
end
φproperty_deriver Make_Abstraction_from_Raw 130
for ( ‹∀x. Premise _ _ ⟶ (x ⦂ Itself 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 ?f x ⦂ ?T)›
| ‹Premise _ _ ⟶ (?x ⦂ Itself 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 ?y ⦂ ?T)›
| ‹∀x. x ⦂ Itself 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 ?f x ⦂ ?T›
| ‹?x ⦂ Itself 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 ?y ⦂ ?T› )
requires Warn_if_contains_Sat
= ‹ Phi_Type_Derivers.Make_Abstraction_from_Raw ›
subsection ‹Destruct Abstraction down to Concrete Representation (by Itself)›
context begin
private lemma φTA_TrRA_rule:
‹ (⋀x. Ant ⟶ (x ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Itself 𝗌𝗎𝖻𝗃 y. r x y) @tag φTA_subgoal (to (Itself::('b,'b) φ)))
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ ∀x. (x ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 (y::'b) ⦂ Itself 𝗌𝗎𝖻𝗃 y. r x y @tag to (Itself::('b,'b) φ)) ›
unfolding Action_Tag_def
by simp
private lemma φTA_TrRA_simp:
‹ ∀x. (x ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 (y::'b) ⦂ Itself 𝗌𝗎𝖻𝗃 y. r x y @tag to (Itself::('b,'b) φ))
⟹ Abstract_Domain T P
⟹ (⋀x y. 𝖼𝗈𝗇𝖽𝗂𝗍𝗂𝗈𝗇 P x ⟹ 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒 r' x y : r x y )
⟹ ∀x. (x ⦂ T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 (y::'b) ⦂ Itself 𝗌𝗎𝖻𝗃 y. r' x y @tag to (Itself::('b,'b) φ)) ›
unfolding Transformation_def Action_Tag_def Satisfiable_def Simplify_def
Abstract_Domain_def Premise_def 𝗋EIF_def
by (clarsimp, smt (verit, del_insts))
ML_file ‹library/phi_type_algebra/open_all_abstraction.ML›
end
φproperty_deriver Open_Abstraction_to_Raw 130 for ( ‹∀x. (x ⦂ ?T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Itself 𝗌𝗎𝖻𝗃 y. ?r x y @tag to Itself)›
| ‹∀x. x ⦂ ?T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Itself 𝗌𝗎𝖻𝗃 y. ?r x y @tag to Itself›
| ‹?x ⦂ ?T 𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ Itself 𝗌𝗎𝖻𝗃 y. ?r' y @tag to Itself›)
requires Warn_if_contains_Sat
= ‹ Phi_Type_Derivers.open_all_abstraction ›
φproperty_deriver Abstraction_to_Raw 131
requires Open_Abstraction_to_Raw and Make_Abstraction_from_Raw
subsection ‹Trim Empty Generated during Separation Extraction›
text ‹For a type operator ‹F›, SE_Trim_Empty generates rules that eliminates into ‹○›
any ‹F ○› generated during Separation Extraction process.
This elimination is derived from ‹Identity_Element›. If the elimination rule is condition-less
(demand no conditional premise nor reasoner subgoals), the rule is activated automatically.
But if there are conditions, the system needs user's discretion to decide if to activate it.
If so, activate deriver ‹SE_Trim_Empty›.
›
lemma [φreason_template name F.φNone [unfolded Premise_def, assertion_simps, simp]]:
‹ Type_Variant_of_the_Same_Type_Operator F F'
⟹ TERM (Identity_Elements⇩I (F ○))
⟹ Identity_Elements⇩I (F ○) D⇩I P⇩I @tag 𝒜_template_reason undefined
⟹ Identity_Elements⇩E (F ○) D⇩E @tag 𝒜_template_reason undefined
⟹ Abstract_Domain (F ○) PD @tag 𝒜_template_reason undefined
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 (∀x. (PD x ⟶ D⇩I x) ∧ D⇩E x)
⟹ NO_SIMP (F ○ = ○) ›
unfolding Object_Equiv_def Identity_Element⇩I_def Identity_Element⇩E_def NO_SIMP_def Action_Tag_def
Identity_Elements⇩I_def Identity_Elements⇩E_def Premise_def Abstract_Domain_def 𝗋EIF_def
Satisfiable_def
apply (rule φType_eqI_Tr; clarsimp simp: Transformation_def)
by meson
subsection ‹Meta Deriver for φ-Type Operator Commutativity›
paragraph ‹Guess Property›
subparagraph ‹Definition of Reasoning Goals›
definition Guess_Tyops_Commute :: ‹ bool
⇒ (('c⇩F,'a⇩F) φ ⇒ ('c,'a) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩G,'a⇩G) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩F,'a⇩F) φ)
⇒ (('c⇩G,'a⇩G) φ ⇒ ('c,'b) φ)
⇒ (('c⇩F,'a⇩F) φ ⇒ ('c,'a) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩G,'a⇩G) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩F,'a⇩F) φ)
⇒ (('c⇩G,'a⇩G) φ ⇒ ('c,'b) φ)
⇒ ('c⇩T,'a⇩T) φ
⇒ ('a ⇒ bool)
⇒ ('a ⇒ 'b ⇒ bool)
⇒ bool ⇒ bool
⇒ bool›
where ‹Guess_Tyops_Commute is_intro G G' F F' unfolded_G unfolded_G' uF uF' T D r ants conds ≡ True›
definition Guess_Tyops_Commute⇩1⇩_⇩2 :: ‹ bool
⇒ (('c⇩G,'a⇩G) φ ⇒ ('c,'a) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩F⇩T,'a⇩F⇩T) φ)
⇒ (('c⇩U,'a⇩U) φ ⇒ ('c⇩F⇩U,'a⇩F⇩U) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩U,'a⇩U) φ ⇒ ('c⇩G,'a⇩G) φ)
⇒ (('c⇩F⇩T,'a⇩F⇩T) φ ⇒ ('c⇩F⇩U,'a⇩F⇩U) φ ⇒ ('c,'b) φ)
⇒ (('c⇩G,'a⇩G) φ ⇒ ('c,'a) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩F⇩T,'a⇩F⇩T) φ)
⇒ (('c⇩U,'a⇩U) φ ⇒ ('c⇩F⇩U,'a⇩F⇩U) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩U,'a⇩U) φ ⇒ ('c⇩G,'a⇩G) φ)
⇒ (('c⇩F⇩T,'a⇩F⇩T) φ ⇒ ('c⇩F⇩U,'a⇩F⇩U) φ ⇒ ('c,'b) φ)
⇒ ('c⇩T,'a⇩T) φ
⇒ ('c⇩U,'a⇩U) φ
⇒ ('b ⇒ bool)
⇒ ('b ⇒ 'a ⇒ bool)
⇒ bool ⇒ bool
⇒ bool›
where ‹Guess_Tyops_Commute⇩1⇩_⇩2 mode F F'⇩T F'⇩U G G' uF uF'⇩T uF'⇩U uG uG' T U D r ants conds ≡ True›
definition Guess_Tyops_Commute⇩2⇩_⇩1 :: ‹ bool
⇒ (('c⇩G,'a⇩G) φ ⇒ ('c,'a) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩F⇩T,'a⇩F⇩T) φ)
⇒ (('c⇩U,'a⇩U) φ ⇒ ('c⇩F⇩U,'a⇩F⇩U) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩U,'a⇩U) φ ⇒ ('c⇩G,'a⇩G) φ)
⇒ (('c⇩F⇩T,'a⇩F⇩T) φ ⇒ ('c⇩F⇩U,'a⇩F⇩U) φ ⇒ ('c,'b) φ)
⇒ (('c⇩G,'a⇩G) φ ⇒ ('c,'a) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩F⇩T,'a⇩F⇩T) φ)
⇒ (('c⇩U,'a⇩U) φ ⇒ ('c⇩F⇩U,'a⇩F⇩U) φ)
⇒ (('c⇩T,'a⇩T) φ ⇒ ('c⇩U,'a⇩U) φ ⇒ ('c⇩G,'a⇩G) φ)
⇒ (('c⇩F⇩T,'a⇩F⇩T) φ ⇒ ('c⇩F⇩U,'a⇩F⇩U) φ ⇒ ('c,'b) φ)
⇒ ('c⇩T,'a⇩T) φ
⇒ ('c⇩U,'a⇩U) φ
⇒ ('a ⇒ bool)
⇒ ('a ⇒ 'b ⇒ bool)
⇒ bool ⇒ bool
⇒ bool›
where ‹Guess_Tyops_Commute⇩2⇩_⇩1 mode F F'⇩T F'⇩U G G' uF uF'⇩T uF'⇩G uG uG' T U D r ants conds ≡ True›
φreasoner_group guess_tyop_commute_all = (100,[10,3000]) for (‹Guess_Tyops_Commute intro F F' G G' unfolded_G unfolded_G' uF uF' T D r ants conds›)
‹Rules guessing the form of the Commutativity between φ-Type Operators›
and guess_tyop_commute = (1000, [1000, 3000]) for (‹Guess_Tyops_Commute intro F F' G G' unfolded_G unfolded_G' uF uF' T D r ants conds›)
in guess_tyop_commute_all
‹User Rules›
and guess_tyop_commute_fallback = (10, [10,10]) for (‹Guess_Tyops_Commute intro F F' G G' unfolded_G unfolded_G' uF uF' T D r ants conds›)
in guess_tyop_commute_all < guess_tyop_commute
‹Fallback rules›
and guess_tyop_commute_default = (15, [11, 39]) for (‹Guess_Tyops_Commute intro F F' G G' unfolded_G unfolded_G' uF uF' T D r ants conds›)
in guess_tyop_commute_all and > guess_tyop_commute_fallback and < guess_tyop_commute
‹Predefined default rules guessing the form of the Commutativity between φ-Type Operators›
declare [[
φreason_default_pattern ‹Guess_Tyops_Commute ?mode ?F _ ?G _ ?uG ?uG' ?uF ?uF' _ _ _ _ _› ⇒
‹Guess_Tyops_Commute ?mode ?F _ ?G _ ?uG ?uG' ?uF ?uF' _ _ _ _ _› (100)
and ‹Guess_Tyops_Commute⇩1⇩_⇩2 ?mode ?F _ _ ?G _ ?uF ?uF⇩T ?uF⇩F ?uG ?uG' _ _ _ _ _ _› ⇒
‹Guess_Tyops_Commute⇩1⇩_⇩2 ?mode ?F _ _ ?G _ ?uF ?uF⇩T ?uF⇩F ?uG ?uG' _ _ _ _ _ _› (100)
and ‹Guess_Tyops_Commute⇩2⇩_⇩1 ?mode ?G _ _ ?F _ ?uG ?uG⇩T ?uG⇩F ?uF ?uF' _ _ _ _ _ _› ⇒
‹Guess_Tyops_Commute⇩2⇩_⇩1 ?mode ?G _ _ ?F _ ?uG ?uG⇩T ?uG⇩F ?uF ?uF' _ _ _ _ _ _› (100)
]]
subparagraph ‹Initialization›
lemma [φreason %guess_tyop_commute_default for ‹Guess_Tyops_Commute _ _ ?var_F' _ _ _ _ _ _ _ _ _ _ _›]:
‹ Parameter_Variant_of_the_Same_Type F var_F'
⟹ Guess_Tyops_Commute Any F var_F' G G' uF uF' uG uG' T D r ants conds
⟹ Guess_Tyops_Commute Any F var_F' G G' uF uF' uG uG' T D r ants conds › .
lemma [φreason %guess_tyop_commute_default for ‹Guess_Tyops_Commute _ _ _ _ ?var_G' _ _ _ _ _ _ _ _ _›]:
‹ Parameter_Variant_of_the_Same_Type G var_G'
⟹ Guess_Tyops_Commute Any F F' G var_G' uF uF' uG uG' T D r ants conds
⟹ Guess_Tyops_Commute Any F F' G var_G' uF uF' uG uG' T D r ants conds› .
lemma [φreason %φTA_guesser_init except ‹Guess_Tyops_Commute True _ _ _ ?var_F' _ _ _ _ _ _ _ _ _›
‹Guess_Tyops_Commute True _ ?var_G' _ _ _ _ _ _ _ _ _ _ _›]:
‹ (⋀T x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_unfolded_G T x) : (x ⦂ G T) )
⟹ (⋀T x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_unfolded_G' T x) : (x ⦂ G' T) )
⟹ Guess_Tyops_Commute True G G' F F' var_unfolded_G var_unfolded_G' uF uF' T D r ants conds
⟹ Guess_Tyops_Commute True G G' F F' var_unfolded_G var_unfolded_G' uF uF' T D r ants conds› .
lemma [φreason %φTA_guesser_init except ‹Guess_Tyops_Commute False _ _ _ ?var_G' _ _ _ _ _ _ _ _ _›
‹Guess_Tyops_Commute False _ ?var_F' _ _ _ _ _ _ _ _ _ _ _›]:
‹ (⋀T x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_unfolded_G T x) : (x ⦂ G T) )
⟹ (⋀T x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_unfolded_G' T x) : (x ⦂ G' T) )
⟹ Guess_Tyops_Commute False F F' G G' uF uF' var_unfolded_G var_unfolded_G' T D r ants conds
⟹ Guess_Tyops_Commute False F F' G G' uF uF' var_unfolded_G var_unfolded_G' T D r ants conds› .
lemma [φreason %φTA_guesser_init]:
‹ Parameter_Variant_of_the_Same_Type F F'⇩T
⟹ Parameter_Variant_of_the_Same_Type F F'⇩U
⟹ Parameter_Variant_of_the_Same_Type G G'
⟹ (⋀T U x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_unfolded_G T U x) : (x ⦂ G T U) )
⟹ (⋀T U x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_unfolded_G' T U x) : (x ⦂ G' T U) )
⟹ Guess_Tyops_Commute⇩1⇩_⇩2 True F F'⇩T F'⇩U G G' uF uF'⇩T uF'⇩U var_unfolded_G var_unfolded_G' T U D r ants conds
⟹ Guess_Tyops_Commute⇩1⇩_⇩2 True F F'⇩T F'⇩U G G' uF uF'⇩T uF'⇩U var_unfolded_G var_unfolded_G' T U D r ants conds› .
lemma [φreason %φTA_guesser_init]:
‹ Parameter_Variant_of_the_Same_Type F F'
⟹ Parameter_Variant_of_the_Same_Type G G'⇩T
⟹ Parameter_Variant_of_the_Same_Type G G'⇩U
⟹ (⋀T x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_unfolded_G T x) : (x ⦂ G T) )
⟹ (⋀T x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_unfolded_G'⇩T T x) : (x ⦂ G'⇩T T) )
⟹ (⋀T x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_unfolded_G'⇩U T x) : (x ⦂ G'⇩U T) )
⟹ Guess_Tyops_Commute⇩1⇩_⇩2 False G G'⇩T G'⇩U F F' var_unfolded_G var_unfolded_G'⇩T var_unfolded_G'⇩U uF uF' T U D r ants conds
⟹ Guess_Tyops_Commute⇩1⇩_⇩2 False G G'⇩T G'⇩U F F' var_unfolded_G var_unfolded_G'⇩T var_unfolded_G'⇩U uF uF' T U D r ants conds› .
lemma [φreason %φTA_guesser_init]:
‹ Parameter_Variant_of_the_Same_Type F F'⇩T
⟹ Parameter_Variant_of_the_Same_Type F F'⇩U
⟹ Parameter_Variant_of_the_Same_Type G G'
⟹ (⋀T U x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_uG T U x) : (x ⦂ G T U) )
⟹ (⋀T U x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_uG' T U x) : (x ⦂ G' T U) )
⟹ Guess_Tyops_Commute⇩2⇩_⇩1 True F F'⇩T F'⇩U G G' uF uF'⇩T uF'⇩U var_uG var_uG' T U D r ants conds
⟹ Guess_Tyops_Commute⇩2⇩_⇩1 True F F'⇩T F'⇩U G G' uF uF'⇩T uF'⇩U var_uG var_uG' T U D r ants conds› .
lemma [φreason %φTA_guesser_init]:
‹ Parameter_Variant_of_the_Same_Type F F'
⟹ Parameter_Variant_of_the_Same_Type G G'⇩T
⟹ Parameter_Variant_of_the_Same_Type G G'⇩U
⟹ (⋀T x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_uG T x) : (x ⦂ G T) )
⟹ (⋀T x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_uG'⇩T T x) : (x ⦂ G'⇩T T) )
⟹ (⋀T x. 𝗌𝗂𝗆𝗉𝗅𝗂𝖿𝗒[φderiver_expansion] (var_uG'⇩U T x) : (x ⦂ G'⇩U T) )
⟹ Guess_Tyops_Commute⇩2⇩_⇩1 False G G'⇩T G'⇩U F F' var_uG var_uG'⇩T var_uG'⇩U uF uF' T U D r ants conds
⟹ Guess_Tyops_Commute⇩2⇩_⇩1 False G G'⇩T G'⇩U F F' var_uG var_uG'⇩T var_uG'⇩U uF uF' T U D r ants conds› .
subparagraph ‹Default Rules›
lemma [φreason %guess_tyop_commute_fallback for ‹Guess_Tyops_Commute _ _ _ _ _ _ _ _ _ _ _ _ _ _›]:
‹ Type_Variant_of_the_Same_Type_Operator F F' ∨⇩c⇩u⇩t True
⟹ Type_Variant_of_the_Same_Type_Operator G G' ∨⇩c⇩u⇩t True
⟹ Guess_Tyops_Commute both F F' G G' uF uF' any any' T (λ_. True) (embedded_func (λx. x) (λ_. True)) True True›
unfolding Guess_Tyops_Commute_def ..
lemma [φreason %guess_tyop_commute_fallback for ‹Guess_Tyops_Commute⇩2⇩_⇩1 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _›]:
‹ Type_Variant_of_the_Same_Type_Operator2 F F' ∨⇩c⇩u⇩t True
⟹ Type_Variant_of_the_Same_Type_Operator G G'⇩T ∨⇩c⇩u⇩t True
⟹ Type_Variant_of_the_Same_Type_Operator G G'⇩U ∨⇩c⇩u⇩t True
⟹ Guess_Tyops_Commute⇩2⇩_⇩1 both G G'⇩T G'⇩U F F' uG uG'⇩T uG'⇩U uF uF' T U
(λ_. True) (embedded_func (λx. x) (λ_. True)) True True ›
unfolding Guess_Tyops_Commute⇩2⇩_⇩1_def ..
lemma [φreason %guess_tyop_commute_fallback for ‹Guess_Tyops_Commute⇩1⇩_⇩2 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _›]:
‹ Type_Variant_of_the_Same_Type_Operator2 G G' ∨⇩c⇩u⇩t True
⟹ Type_Variant_of_the_Same_Type_Operator F F'⇩T ∨⇩c⇩u⇩t True
⟹ Type_Variant_of_the_Same_Type_Operator F F'⇩U ∨⇩c⇩u⇩t True
⟹ Guess_Tyops_Commute⇩1⇩_⇩2 both F F'⇩T F'⇩U G G' uF uF'⇩T uF'⇩U uG uG' T U
(λ_. True) (embedded_func (λx. x) (λ_. True)) True True ›
unfolding Guess_Tyops_Commute⇩1⇩_⇩2_def ..
subparagraph ‹ML›
ML_file ‹library/phi_type_algebra/guess_tyops_commute.ML›
subparagraph ‹Templates›
context begin
private lemma Guess_Tyops_Commute_by_unfolding_1:
‹ (⋀T x. A T x = A' T x)
⟹ Guess_Tyops_Commute mode G G' F F' uG uG' A' uF' T D R a c
⟹ Guess_Tyops_Commute mode G G' F F' uG uG' A uF' T D R a c ›
by presburger
private lemma Guess_Tyops_Commute_by_unfolding_2:
‹ (⋀T x. A T x = A' T x)
⟹ Guess_Tyops_Commute mode G G' F F' uG uG' uF A' T D R a c
⟹ Guess_Tyops_Commute mode G G' F F' uG uG' uF A T D R a c ›
by presburger
private lemma Guess_Tyops_Commute_by_unfolding_3:
‹ (⋀T x. A T x = A' T x)
⟹ Guess_Tyops_Commute mode G G' F F' A' uG' uF uF' T D R a c
⟹ Guess_Tyops_Commute mode G G' F F' A uG' uF uF' T D R a c ›
by presburger
private lemma Guess_Tyops_Commute_by_unfolding_4:
‹ (⋀T x. A T x = A' T x)
⟹ Guess_Tyops_Commute mode G G' F F' uG A' uF uF' T D R a c
⟹ Guess_Tyops_Commute mode G G' F F' uG A uF uF' T D R a c ›
by presburger+
lemmas Guess_Tyops_Commute_by_unfolding =
Guess_Tyops_Commute_by_unfolding_1 Guess_Tyops_Commute_by_unfolding_2
Guess_Tyops_Commute_by_unfolding_3 Guess_Tyops_Commute_by_unfolding_4
end
subparagraph ‹Deriving Bubbling ToA›
paragraph ‹Deriver›
φreasoner_group derived_commutativity_deriver = (150, [150, 151 ]) for ‹_›
‹The priority of derived deriver for commutativity between type operators›
lemma φTA_TyComm⇩I_gen:
‹ Parameter_Variant_of_the_Same_Type F F'
⟹ 𝗋Success
⟹ (⋀x. Ant ⟶
𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x ⟶
(x ⦂ OPEN undefined (G (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F T))
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F' (MAKE undefined (G' T)) 𝗌𝗎𝖻𝗃 y. r x y)
@tag φTA_subgoal 𝒜simp)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Tyops_Commute G G' F F' T D r›
unfolding Action_Tag_def Tyops_Commute_def Premise_def Bubbling_def MAKE_def OPEN_def
by blast
lemma φTA_TyComm⇩E_gen:
‹ Parameter_Variant_of_the_Same_Type F F'
⟹ 𝗋Success
⟹ (⋀x. Ant ⟶
𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x ⟶
(x ⦂ 𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F (OPEN undefined (G T))
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ MAKE undefined (G' (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F' T)) 𝗌𝗎𝖻𝗃 y. r x y)
@tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Tyops_Commute F F' G G' T D r›
unfolding Action_Tag_def Tyops_Commute_def Premise_def embedded_func_def Bubbling_def OPEN_def MAKE_def
by clarsimp
lemma φTA_TyComm⇩1⇩_⇩2⇩I_gen:
‹ Parameter_Variant_of_the_Same_Type F F'⇩T
⟹ Parameter_Variant_of_the_Same_Type F F'⇩U
⟹ 𝗋Success
⟹ (⋀x. Ant ⟶
𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x ⟶
(x ⦂ OPEN undefined (G' (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F'⇩T T) (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F'⇩U U))
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F (MAKE undefined (G T U)) 𝗌𝗎𝖻𝗃 y. r x y)
@tag φTA_subgoal 𝒜simp)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Tyops_Commute⇩2⇩_⇩1 F F'⇩T F'⇩U G G' T U D r›
unfolding Action_Tag_def Tyops_Commute⇩2⇩_⇩1_def Premise_def Bubbling_def OPEN_def MAKE_def
by blast
lemma φTA_TyComm⇩1⇩_⇩2⇩E_gen:
‹ Parameter_Variant_of_the_Same_Type F F'⇩T
⟹ Parameter_Variant_of_the_Same_Type F F'⇩U
⟹ 𝗋Success
⟹ (⋀x. Ant ⟶
𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x ⟶
(x ⦂ 𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F (OPEN undefined (G T U))
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ MAKE undefined (G' (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F'⇩T T) (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F'⇩U U)) 𝗌𝗎𝖻𝗃 y. r x y)
@tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Tyops_Commute⇩1⇩_⇩2 F F'⇩T F'⇩U G G' T U D r›
unfolding Action_Tag_def Tyops_Commute⇩1⇩_⇩2_def Premise_def embedded_func_def OPEN_def MAKE_def Bubbling_def
by clarsimp
lemma φTA_TyComm⇩2⇩_⇩1⇩I_gen:
‹ Parameter_Variant_of_the_Same_Type F F'
⟹ 𝗋Success
⟹ (⋀x. Ant ⟶
𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x ⟶
(x ⦂ OPEN undefined (G (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F T U))
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ F' (MAKE undefined (G'⇩T T)) (MAKE undefined (G'⇩U U)) 𝗌𝗎𝖻𝗃 y. r x y)
@tag φTA_subgoal 𝒜simp)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Tyops_Commute⇩1⇩_⇩2 G G'⇩T G'⇩U F F' T U D r›
unfolding Action_Tag_def Tyops_Commute⇩1⇩_⇩2_def Premise_def Bubbling_def OPEN_def MAKE_def
by clarsimp
lemma φTA_TyComm⇩2⇩_⇩1⇩E_gen:
‹ Parameter_Variant_of_the_Same_Type F F'
⟹ 𝗋Success
⟹ (⋀x. Ant ⟶
𝗉𝗋𝖾𝗆𝗂𝗌𝖾 D x ⟶
(x ⦂ 𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F' (OPEN undefined (G'⇩T T)) (OPEN undefined (G'⇩U U))
𝗍𝗋𝖺𝗇𝗌𝖿𝗈𝗋𝗆𝗌 y ⦂ MAKE undefined (G (𝖻𝗎𝖻𝖻𝗅𝗂𝗇𝗀 F T U)) 𝗌𝗎𝖻𝗃 y. r x y)
@tag φTA_subgoal undefined)
⟹ 𝗋Success
⟹ 𝗈𝖻𝗅𝗂𝗀𝖺𝗍𝗂𝗈𝗇 True
⟹ Ant @tag φTA_ANT
⟹ Tyops_Commute⇩2⇩_⇩1 G G'⇩T G'⇩U F F' T U D r›
unfolding Action_Tag_def Tyops_Commute⇩2⇩_⇩1_def Premise_def embedded_func_def OPEN_def MAKE_def Bubbling_def
by clarsimp
ML_file ‹library/phi_type_algebra/gen_tyops_commute.ML›
φproperty_deriver Commutativity_Deriver⇩I 200
= ‹fn quiet => K (Phi_Type_Derivers.meta_Tyops_Commute (false, 1) quiet) ›
φproperty_deriver Commutativity_Deriver⇩E 200
= ‹fn quiet => K (Phi_Type_Derivers.meta_Tyops_Commute (false, 2) quiet) ›
φproperty_deriver Commutativity_Deriver 200
= ‹fn quiet => K (Phi_Type_Derivers.meta_Tyops_Commute (false, 3) quiet) ›
φproperty_deriver Commutativity_Deriver⇩I_rev 200
= ‹fn quiet => K (Phi_Type_Derivers.meta_Tyops_Commute (true, 2) quiet) ›
φproperty_deriver Commutativity_Deriver⇩E_rev 200
= ‹fn quiet => K (Phi_Type_Derivers.meta_Tyops_Commute (true, 1) quiet) ›
φproperty_deriver Commutativity_Deriver_rev 200
= ‹fn quiet => K (Phi_Type_Derivers.meta_Tyops_Commute (true, 3) quiet) ›
section ‹Deriving Configures for Specific Abstract Algebras›
subsubsection ‹Common›
lemmas [φderiver_simps] =
Nat.add_Suc_right Groups.monoid_add_class.add.right_neutral Nat.nat.inject
lemmas [φderiver_simps] =
Basic_BNFs.prod_set_defs
declare option.rel_eq[iff] option.pred_True[iff]
subsubsection ‹List›
declare list.rel_eq[iff] list.pred_True[iff]
setup ‹Sign.mandatory_path "list"›
abbreviation ‹unzip l ≡ (map fst l, map snd l)›
lemma case_unzip[simp]:
‹(case list.unzip x of (a,b) ⇒ f a b) = (let a = map fst x; b = map snd x in f a b)›
by simp
lemma zip_unzip[iff]:
‹ case_prod zip (list.unzip l) = l ›
by (simp add: zip_map_fst_snd)
lemma unzip_zip[iff]:
‹ length x = length y
⟹ list.unzip (zip x y) = (x,y) ›
by simp
lemma zip_eq_Cons_ex:
‹zip x y = (h#l) ⟷ (∃ah al bh bl. x = ah # al ∧ y = bh # bl ∧ (ah,bh) = h ∧ zip al bl = l)›
by (simp, induct_tac y; case_tac x; simp)
lemma zip_eq_Nil_eq_len:
‹length x = length y ⟹ (zip x y = []) ⟷ x = [] ∧ y = []›
by (simp; induct x; cases y; simp)
lemma zip_eq_Nil_with_rel:
‹list_all2 P a b ∧ zip a b = [] ⟷ a = [] ∧ b = []›
by (induct b; cases a; simp)
setup ‹Sign.parent_path›
lemma map_prod_case_analysis:
‹map (λx. (f x, g x)) la = lb ≡ map f la = map fst lb ∧ map g la = map snd lb ›
by (induct la arbitrary: lb; clarsimp; fastforce)
lemma list_all2__const_True[simp]:
‹list_all2 (λx y. True) = (λx y. length x = length y)›
apply (clarsimp simp add: fun_eq_iff)
subgoal for x y
by (induct x arbitrary: y; simp; case_tac y; simp) .
term ‹list.unzip :: ('a × 'b) list ⇒ 'a list × 'b list›
setup ‹ Context.theory_map(
BNF_FP_Sugar_More.add_fp_more (\<^type_name>‹list›, {
deads = [],
lives = [\<^typ>‹'a›],
lives'= [\<^typ>‹'b›],
zip = \<^term>‹case_prod zip :: 'a list × 'b list ⇒ ('a × 'b) list›,
unzip = \<^term>‹list.unzip :: ('a × 'b) list ⇒ 'a list × 'b list›,
zip_simps = @{thms' list.zip_unzip list.unzip_zip list.zip_eq_Cons_ex list.zip_eq_Nil_eq_len
length_map length_zip zip_map1 zip_map2 zip_map_fst_snd
List.zip_map_fst_snd map_zip_map map_zip_map2
map_prod_case_analysis}
}))
›
lemma list_all2_reduct_rel[simp]:
‹list_all2 (λa b. b = f a ∧ P a) = (λa' b'. b' = map f a' ∧ list_all P a')›
apply (clarsimp simp add: fun_eq_iff)
subgoal for x y by (induct x arbitrary: y; simp; case_tac y; simp; blast) .
lemmas [φderiver_simps] =
list.size map_eq_Cons_conv list_all2_lengthD[THEN HOL.Eq_TrueI]
paragraph ‹Separatable Mappers›
lemma [φreason add]:
‹compositional_mapper map map map UNIV f g›
unfolding compositional_mapper_def
by clarsimp
lemma [φreason add]:
‹separatable_unzip (case_prod zip) list.unzip UNIV map map map f g›
unfolding separatable_unzip_def
by (clarsimp simp add: zip_eq_conv)
lemma [φreason add]:
‹separatable_zip list.unzip (case_prod zip) {(la,lb). length la = length lb} map map map f g›
unfolding separatable_zip_def
by (clarsimp simp add: zip_eq_conv, metis map_fst_zip map_map map_snd_zip)
lemma [φreason add]:
‹domain_by_mapper set map set f UNIV›
unfolding domain_by_mapper_def
by clarsimp
lemma [φreason add]:
‹domain_of_inner_map map set›
unfolding domain_of_inner_map_def
by clarsimp
subsubsection ‹Sum›
lemma pred_sum_eq_case_sum[φderiver_simps]:
‹pred_sum P Q x ⟷ case_sum P Q x›
by (cases x; simp)
lemma collapse_case_sum[simp]:
‹(case x of Inl x ⇒ Inl x | Inr x ⇒ Inr x) = x›
by (cases x; simp)
subsubsection ‹Set›
lemma rel_set__const_True[simp]:
‹rel_set (λx y. True) = (λx y. x = {} ⟷ y = {})›
by (clarsimp simp add: fun_eq_iff rel_set_def; blast)
setup ‹ Context.theory_map (eBNF_Info.add_BNF (\<^type_name>‹Set.set›,
let val a = TFree ("a", \<^sort>‹type›)
val b = TFree ("b", \<^sort>‹type›)
in {
T = \<^Type>‹Set.set a›,
Tname = \<^type_name>‹Set.set›,
casex = NONE,
case_distribs = [],
ctrs = [\<^Const>‹bot \<^Type>‹set a››, \<^Const>‹insert a›, \<^Const>‹sup \<^Type>‹set a››],
deads = [], lives = [a], lives'= [b],
sets = [Abs("x", \<^Type>‹Set.set a›, Bound 0)],
set_thms = [],
ctr_simps = [],
rel = \<^Const>‹rel_set a b›,
rel_simps = @{thms' Lifting_Set.empty_transfer rel_set__const_True},
rel_eq = @{thm' rel_set_eq},
pred = Abs("P", a --> HOLogic.boolT, Abs ("S", \<^Type>‹Set.set a›, \<^Const>‹Ball a› $ Bound 0 $ Bound 1)),
pred_injects = @{thms' Set.ball_simps(5) Set.ball_Un Set.ball_simps(7)},
pred_simps = @{thms' Set.ball_simps},
map = \<^Const>‹Set.image a b›,
map_thms = @{thms' Set.image_insert Set.image_Un Set.image_empty},
map_disc_iffs = @{thms' image_is_empty},
map_ident = @{thm' Set.image_ident},
map_comp_of = @{thm' Set.image_image},
fp_more = SOME {
deads = [],
lives = [a],
lives'= [b],
zip = \<^term>‹case_prod (×) :: 'a set × 'b set ⇒ ('a × 'b) set›,
unzip = \<^term>‹(λs. (Domain s, Range s)) :: ('a × 'b) set ⇒ 'a set × 'b set›,
zip_simps = []
}
} end)
)›
lemmas [φderiver_simps] =
Set.ball_Un Fun.bind_image Set.empty_bind Set.bind_singleton_conv_image
Set.nonempty_bind_const Finite_Set.finite_bind
lemma Set_bind_insert[simp, φderiver_simps]:
‹Set.bind (insert x S) f = f x ∪ Set.bind S f›
unfolding Set.bind_def
by auto
subsubsection ‹Function›
definition ‹zip_fun = case_prod BNF_Def.convol›
definition ‹unzip_fun f = (fst o f, snd o f)›
lemma zip_fun_inj[simp]:
‹fst o (zip_fun f) = fst f›
‹snd o (zip_fun f) = snd f›
unfolding zip_fun_def fun_eq_iff BNF_Def.convol_def
by (cases f; clarsimp)+
lemma zip_fun_inj'[simp]:
‹fst (zip_fun f x) = fst f x›
‹snd (zip_fun f x) = snd f x›
unfolding zip_fun_def fun_eq_iff BNF_Def.convol_def
by (cases f; clarsimp)+
lemma zip_fun_map:
‹zip_fun (f o x, y) = apfst f o zip_fun (x, y)›
‹zip_fun (x, g o y) = apsnd g o zip_fun (x, y)›
unfolding zip_fun_def BNF_Def.convol_def
by clarsimp+
lemma zip_fun_prj[simp]:
‹fst (unzip_fun x) = fst o x›
‹snd (unzip_fun x) = snd o x›
unfolding unzip_fun_def
by clarsimp+
lemma map_fun_prod_case_analysis:
‹(λx. (f x, g x)) o a = b ≡ f o a = fst o b ∧ g o a = snd o b›
unfolding atomize_eq fun_eq_iff
by (clarsimp, rule, metis fst_eqD snd_conv, clarsimp)
setup ‹ Context.theory_map(
let val (i, a, b) = (\<^typ>‹'i›, \<^typ>‹'a›, \<^typ>‹'b›)
in BNF_FP_Sugar_More.add_fp_more (\<^type_name>‹fun›, {
deads = [i], lives = [a], lives'= [b],
zip = \<^Const>‹zip_fun i a b›,
unzip = \<^Const>‹unzip_fun i a b›,
zip_simps = @{thms' zip_fun_inj zip_fun_inj' zip_fun_map zip_fun_prj map_fun_prod_case_analysis}
}) end)
›
lemma rel_fun__const_True[simp]:
‹rel_fun (=) (λx y. True) = (λx y. True)›
by (simp add: fun_eq_iff rel_fun_def)
subsubsection ‹Option›
setup ‹ Context.theory_map(
let val (a, b) = (\<^typ>‹'a›, \<^typ>‹'b›)
in BNF_FP_Sugar_More.add_fp_more (\<^type_name>‹option›, {
deads = [], lives = [a], lives'= [b],
zip = \<^Const>‹zip_option a b›,
unzip = \<^Const>‹unzip_option a b›,
zip_simps = @{thms' zip_option_simps unzip_option_simps unzip_zip_option zip_option_prj}
}) end)
›
subsubsection ‹Production›
lemma [φderiver_simps, simp]:
‹pred_prod (λa. True) P x ⟷ P (snd x)›
‹pred_prod Q (λa. True) x ⟷ Q (fst x)›
by (cases x; simp)+
declare Lifting.pred_prod_beta[φgeneration_simp]
section ‹Clean-up›
hide_const (open) introduced
chapter ‹Typeclass›
ML_file ‹library/typeclass.ML›
end